hal: type bug in hal_hotplug.c

Robert Love rml at ximian.com
Tue Mar 30 03:34:40 EEST 2004


On Mon, 2004-03-29 at 19:08, David Zeuthen wrote:

Hi, David!

> Btw, these are still a bit off, since path is only PATH_MAX and strncat
> appends a maximum of PATH_MAX of src to dst, which means a potential
> buffer overflow - udev uses a macro to implement a sane strncat, maybe
> we should do the same?

We can.  The macros that udev has are not overly efficient - they just
use "strlen()" to ensure proper buffer space.  But we can do the same.

Attached patch adds a "strcat_len()" macro, which is similar to the safe
"strcat()" that udev has and then converts all "strncat()" users to it.

Seems right.

	Robert Love

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-add-strcat_len.patch
Type: text/x-diff
Size: 1414 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20040329/2797748f/attachment.patch 


More information about the xdg mailing list