chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] Replace unsafe string functions with their


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Replace unsafe string functions with their safer counterparts
Date: Fri, 7 Feb 2014 21:27:04 +0100
User-agent: Mutt/1.4.2.3i

On Fri, Feb 07, 2014 at 12:52:50AM +0000, Mario Domenech Goulart wrote:
> I quickly tested your patches.
> 
> 0001-Prevent-problems-when-the-host... breaks Linux and mingw-msys
> ("undefined reference to strlcat").  Doesn't seem to cause problems on
> cygwin.

Thanks for testing.  I checked and it was a simple case of a #ifndef
which should be a #ifdef (and also the strlcpy inside C_strlcat should
be changed to C_strlcpy as well).

> 0002-Fix-strlcat-usage-in-setenv... doesn't fix the setenv issue (tested
> on Windows XP, cygwin).

This was probably due to the buf[n1]='=', which would overwrite the
NUL character.  The old code would simply strncpy onto the target
address so it didn't matter.  Because this isn't terribly performance-
sensitive I decided to convert this to C_strlcat(buf, "=", buf_len).

It works in Linux, and on Cygwin it now works up until the deploy tests.
Those seem to be broken here, but I'm not sure why exactly.  At least
this patch doesn't make things worse so I think it should be applied.
We can then investigate further why the deploy tests aren't working.

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Prevent-problems-when-the-host-system-does-provide-s.patch
Description: Text document

Attachment: 0002-Fix-strlcat-usage-in-setenv-use-the-start-of-the-str.patch
Description: Text document


reply via email to

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