I'm not sure of where to post bug reports, hope i'm at the right place...
I found a buffer overflow problem in the pspDebugScreenPrintf() function. You can observe it by trying to output a string of more than 2048 characters with that function: the end (and possibly all) of the displaying will be totally messy.
I took a look at the file scr_printf.c and seen that pspDebugScreenPrintf() asks vsnprintf() to do the formatting stuff and considers that the return value is the number of characters actually printed, as specified in C89. But in C99, the return value is now the number of characters that WOULD HAVE been printed if the length of the preallocated buffer would have been sufficient. So the pspDebugScreenPrintData() then issues a buffer overflow by considering the size passed in parameter as being the actual size of the buffer.
So I think that it would be better to not use the return value of vsnprintf(), and call pspDebugScreenPrintData() like that:
Code: Select all
(void) pspDebugScreenPrintData(buff, sizeof(buff));
Hope this can help...