[haiku-bugs] Re: [Haiku] #9528: stop_watching() KDLs on page fault, monitoring a CDDA

  • From: "korli" <trac@xxxxxxxxxxxx>
  • Date: Wed, 16 Apr 2014 11:31:27 -0000

#9528: stop_watching() KDLs on page fault, monitoring a CDDA
-----------------------------+----------------------------
   Reporter:  ttcoder        |      Owner:  axeld
       Type:  bug            |     Status:  new
   Priority:  normal         |  Milestone:  R1
  Component:  System/Kernel  |    Version:  R1/Development
 Resolution:                 |   Keywords:
 Blocked By:                 |   Blocking:
Has a Patch:  0              |   Platform:  All
-----------------------------+----------------------------

Comment (by korli):

 I had a look at cdda.cpp, I think the function to_utf8() has a loop
 problem possibly unrelated to the failure encountered by the OP:

 We check that "out == sizeof(buffer) - 1" is false, but later for "c"
 between 0x80 and 0x800, we increment "out" twice, which might miss the
 check on the next iteration.

 So line 60 should be:
 {{{
     if (out >= sizeof(buffer) - 2)
 }}}

 or we could add a second check line 66 leading to a loop break.

--
Ticket URL: <https://dev.haiku-os.org/ticket/9528#comment:6>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: