[haiku-bugs] Re: [Haiku] #6417: __printf_fphex crashes in haiku

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Mon, 02 Aug 2010 17:45:51 -0000

#6417: __printf_fphex crashes in haiku
--------------------------------+-------------------------------------------
  Reporter:  MrSunshine         |         Owner:  zooey         
      Type:  bug                |        Status:  closed        
  Priority:  normal             |     Milestone:  R1            
 Component:  System/libroot.so  |       Version:  R1/Development
Resolution:  invalid            |      Keywords:                
Blocked By:                     |   Has a Patch:  0             
  Platform:  All                |      Blocking:                
--------------------------------+-------------------------------------------
Changes (by bonefish):

  * status:  assigned => closed
  * resolution:  => invalid


Comment:

 The first format specification is `%x`, which expects a signed or unsigned
 int, but the respective argument is `0.2f`, which is a float. The float
 gets converted to double when passed via varargs, so this has indeed a
 good chance to crash on any system where `sizeof(int) != sizeof(double)`,
 since part of the double argument will be interpreted as a string pointer.

 BTW, `-Wall` is your friend.

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

Other related posts: