This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch 3/4]: Rewrite of the alpha-vms bfd back-end (ld)


Hi Tristan,

+  string = (char *) xmalloc (strlen (search->name)
+			     + strlen (entry->filename)
+			     + sizeof "/.exe");
+
+  sprintf (string, "%s/%s.exe", search->name, entry->filename);

What about the zero-terminator for the string ? Ie this looks like a possible memory corruption bug to me.

Isn't sizeof ("./exe") == 6 (ie, strlen + 1) ?

Mea culpa. You're right. Patch approved.


Cheers
  Nick



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