mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
apps: fix use of negative fd in open_plugin.c
Bug reported by UBSan. Change-Id: I3223a496dfa5df4e3df97fb88a14ea0174d4b428
This commit is contained in:
parent
dadfbfc6a5
commit
6e37b31851
1 changed files with 2 additions and 0 deletions
|
@ -222,6 +222,8 @@ static int op_get_entry(uint32_t hash, int32_t lang_id,
|
|||
logf("OP get_entry hash: %x lang id: %d db: %s", hash, lang_id, dat_file);
|
||||
|
||||
int fd = open(dat_file, O_RDONLY);
|
||||
if(fd < 0)
|
||||
return OPEN_PLUGIN_NOT_FOUND;
|
||||
opret = op_find_entry(fd, entry, hash, lang_id);
|
||||
close(fd);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue