chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Fix segfault in get-environment-variable and t


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix segfault in get-environment-variable and three C compiler warnings
Date: Sat, 24 Nov 2018 12:46:07 +0100
User-agent: NeoMutt/20170113 (1.7.2)

Hi all,

Moritz was compiling CHICKEN with gcc 7 (or perhaps a newer libc?) that
gave warnings like "null argument where it was not expected".  The
attached patch fixes those warnings, and I also noticed that if you
call get-environment-variable with #f as an argument, you would get a
segmentation fault.

I noticed that the other two places; file-link and set-root-directory!
already explicitly check the argument(s) for being strings.  The patch
is the smallest possible change to get rid of the compiler warnings and
also fix the segfault, but perhaps we want to remove those checks from
posixunix.scm, given that they're strictly redundant.  Or, we might
add such a check to library.scm because the error message is a bit
better when it includes the procedure name, and none of these procedures
should be very performance-sensitive anyway.

Cheers,
Peter

Attachment: 0001-Change-definition-of-link-chroot-and-C_getenv-from-c.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]