Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Playlists
  • Assigned To No-one
  • Operating System All players
  • Severity Medium
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by thomasjfox - 2011-02-16
Last edited by thomasjfox - 2011-02-18

FS#11947 - Fix off-by-one buffer access in playlist.c

Hello,

attached patch fixes an off-by-one buffer access in playlist.c
detected by valgrind:

==9476== Conditional jump or move depends on uninitialised value(s)
==9476== at 0x414D48: format_track_path (playlist.c:1663)
==9476== by 0×417969: playlist_save (playlist.c:3350)
==9476== by 0x40E0F0: save_playlist_screen (playlist_menu.c:55)
==9476== by 0x4081B3: do_menu (menu.c:580)
==9476== by 0x41AAF4: miscscrn (root_menu.c:323)
==9476== by 0x41ACD0: load_screen (root_menu.c:519)
==9476== by 0x41AF4F: root_menu (root_menu.c:687)
==9476== by 0x406ECA: main (main.c:196)

We first have to check the current position and then read the memory.

It’s a bit odd the comment of the code says

“/* Zero-terminate the file name */

and all it does is look for \r or \n?

Cheers,
Thomas

Closed by  thomasjfox
2011-02-18 21:57
Reason for closing:  Fixed

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing