This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unitialized memory in output_file_names


>>>>> "Matt" == Matt Kraai <kraai@alumni.carnegiemellon.edu> writes:

Matt> On Tue, Mar 13, 2001 at 05:58:46PM +0200, Momchil Velikov wrote:
>> This patch fixes a read of uninitialized variable.
[...]
>> dirs[0].prefix = -1;
>> !   dirs[0].nbytes = files[1].length - dirs[1].length + 1;
>> dirs[0].count = 1;
>> dirs[0].dir_idx = 0;
>> dirs[0].used = 0;
>> --- 6766,6772 ----
>> dirs[0].path = files[1].path;
>> dirs[0].length = files[1].fname - files[1].path;
>> dirs[0].prefix = -1;
>> !   dirs[0].nbytes = files[1].length - dirs[0].length + 1;
[...]

Matt> There is a similar problem 26 lines down where it states

Matt>         dirs[ndirs].nbytes = files[i].length - dirs[i].length + 1;

Matt> This should probably be

Matt>         dirs[ndirs].nbytes = files[i].length - dirs[ndirs].length + 1;

Indeed, that one too.

Actually, I can't see ``nbytes'' used anywhere, maybe just delete it ?

Regards,
-velco


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]