Skip to content

Prevent uninitialized memory when searching for serial in database.#18320

Merged
LibretroAdmin merged 1 commit intolibretro:masterfrom
zoltanvb:empty_serial_fix
Oct 20, 2025
Merged

Prevent uninitialized memory when searching for serial in database.#18320
LibretroAdmin merged 1 commit intolibretro:masterfrom
zoltanvb:empty_serial_fix

Conversation

@zoltanvb
Copy link
Copy Markdown
Contributor

@zoltanvb zoltanvb commented Oct 18, 2025

Description

When serial can not be retrieved from the image (length is 0), the translation for the database search syntax may return uninitialized memory, resulting in bogus database hits (which are not written to playlist), but also in endless scanning.

Scanning one such image was failing (running endlessly) at least once in ten tries, with the modification, the endless scan can not be reproduced any more.

Related Issues

Closes #16906 (most probably). Maybe also #10876 , as the trace also points to serial scanning.

@sonninnos
Copy link
Copy Markdown
Collaborator

Why not just clear the var always without the if before the for loop?

@zoltanvb
Copy link
Copy Markdown
Contributor Author

Sure, why not.

Comment thread database_info.c Outdated
@LibretroAdmin LibretroAdmin merged commit 8c10eaa into libretro:master Oct 20, 2025
31 checks passed
@zoltanvb zoltanvb deleted the empty_serial_fix branch October 21, 2025 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "Scan Directory" function does not work well with some ISO images

3 participants