Possible bugs
Dominic Plunkett (2556) 34 posts |
Some of these are minor, some issues may not actually exist. These have been found with CPPcheck. Fixed Fixed Fixed Fixed Fixed Fixed Fixed Fixed Fixed |
Dominic Plunkett (2556) 34 posts |
File removed |
Jon Abbott (1421) 2651 posts |
You should probably provide links to the source lines in question as the code is frequently updated. |
Dominic Plunkett (2556) 34 posts |
Fixed – \BCM2835Dev\mixed\RiscOS\Sources\HWSupport\USB\USBDriver\build\c\ohcimodule Line 741 tok buffer is too small. - I’ll look into providing links |
Jon Abbott (1421) 2651 posts |
I’ll get you started: mixed/RiscOS/Sources/HWSupport/USB/USBDriver/build/c/ohcimodule line 741 |
Dominic Plunkett (2556) 34 posts |
links added to original posts |
Dominic Plunkett (2556) 34 posts |
Removed from build Not a bug |
Rick Murray (539) 13850 posts |
Are you sure? I’ve noticed with examining some of my own code that it can return some rather eccentric results. In this case it looks like the array index is always counted to be less than BUSCOUNT (which is the size of the array), once in a local loop, and once via a function. In this case, we have the code you linked to, and we have find_free_bus(). I can’t quote here as my phone badly messes up quoting; suffice to say that how ‘b’ gets to be 4 (which I presume is the value of BUSCOUNT) eludes me.
Yup. That one is a bug. If your array is 20 bytes, you don’t want a function that picks the smaller of the string length or 20, and pokes a terminull there, as array[20] means the elements go 0…19. ;-) |
Dominic Plunkett (2556) 34 posts |
Looking at the code again you are right bustable isn’t accessed at index 4 |
Rick Murray (539) 13850 posts |
This depends. The array is 14 if not long names and 17 or so otherwise. The offending code looks to be in a code block “ |
Rick Murray (539) 13850 posts |
That entire code block. uc is defined as 4 bytes, then several loops access it like… for (i=0; i<8; i++) I’m guessing uc ought to be eight bytes.
The memory leaks that I’ve looked at are the result of bombing out early because something went wrong after having allocated memory for the array, but not having freed it before returning zero… |
Dominic Plunkett (2556) 34 posts |
I think some more brackets are needed same here too : Do we need some {} here : fixed Fixed |
Rick Murray (539) 13850 posts |
Hmm… You’d have thought that C would interpret that as |
Dominic Plunkett (2556) 34 posts |
given TextArea_DesktopColours = 1<<0 this simplifies to just ‘if (flags)’ is this what the programmer wanted ? |
Dominic Plunkett (2556) 34 posts |
fixed
Always evaluates to false :
|