[haiku-bugs] Re: [Haiku] #9486: iso9660 file system driver buffer overflows

  • From: "pdziepak" <trac@xxxxxxxxxxxx>
  • Date: Thu, 28 Feb 2013 20:51:36 -0000

#9486: iso9660 file system driver buffer overflows
-------------------------------------+----------------------------
   Reporter:  beos_zealot            |      Owner:  nobody
       Type:  bug                    |     Status:  new
   Priority:  normal                 |  Milestone:  R1
  Component:  File Systems/ISO 9660  |    Version:  R1/Development
 Resolution:                         |   Keywords:
 Blocked By:                         |   Blocking:
Has a Patch:  1                      |   Platform:  All
-------------------------------------+----------------------------

Comment (by pdziepak):

 Wouldn't it be neater if the value of `sizeof(anArrayWeWantToWriteTo) - 1`
 was firstly assigned to some `const size_t` constant and then used three
 times: zeroing the last byte of the array, setting length for `strncpy()`
 and increasing buffer pointer? The compiler will optimize it anyway and we
 won't end up with six `volume->copyright` in four consecutive lines.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/9486#comment:9>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: