Rockbox mail archiveSubject: Possible Filename Buffer Overrun
Possible Filename Buffer Overrun
From: Stuart Tedford <stuart.tedford_at_piresearch.co.uk>
Date: Wed, 10 Jul 2002 09:45:39 +0100
I have done some more investigation into this bug. The scrolling filename
on the top line of the screen when playing a file eventually shows
unrecognised characters (usually displayed as '?') when I play a file with a
long file name such as:
"/MP3/MP3_Old/Smashing Pumpkins - The Aeroplane Flies High - Thirty
Three/03_The Aeroplane Flies High (Turns Left, Looks Right).mp3"
To save you counting, this filename and path is 130 chars long.
The scrolling display shows the filename across the screen until the very
last char (the '3' in ".....mp3") ie 129 chars, where it begins to display
'?' chars for a while with the odd '/' and other weird chars thrown in until
recovering back to the start again and repeating the whole process. I
presume the pointer that the scroller is reading from eventually finds a
NULL somewhere off the end of the buffer.
I haven't looked at the code, but what I think is happening is that the file
name buffer (rather than the scroller code) is at fault, and is not large
enough to store a filename of this length - and so is not appending a null
to the buffer - or worse - is writing past the end of the buffer. In my
experience, a filename buffer should be 256 chars - thanks to windoze. If
this is not acceptable then the file name should be truncated properly.
Does anyone else have long filenames - or is it just me?
Received on 2002-07-10