gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Patch for ~username code


From: Jerry James
Subject: [Gcl-devel] Patch for ~username code
Date: Wed, 5 Nov 2008 07:12:26 -0700

This is another patch against 2.6.7 + the current Debian patch.  This
one does a couple of minor cleanups to the code that handles filenames
starting with "~username".  First, such names may be greater than 20
characters long, so this code may overflow its buffer.  On Fedora,
they can be 256 characters long.  The patch uses LOGIN_NAME_MAX
instead.  Second, the variable "q" is initialized twice with the same
value, so this patch removes the second initialization.  Finally,
since we already know that q[0] == '~', there is no point in starting
the loop at index 0.  Starting it at index 1 also gets gcc to stop
whining about a possibly negative array index when setting name[n - 1]
to zero.

Regards,
-- 
Jerry James
http://loganjerry.googlepages.com/

Attachment: gcl-2.6.7-loginname.patch
Description: Text Data


reply via email to

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