Skip to content

Commit

Permalink
audcore: Prevent buffer overflow. Closes: #1541
Browse files Browse the repository at this point in the history
When iterating the default configuration settings we did not properly
check for the array end, leading to an invalid out-of-bounds access.
  • Loading branch information
radioactiveman committed Jan 5, 2025
1 parent a388e0a commit b19b438
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libaudcore/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,11 @@ EXPORT void aud_config_set_defaults(const char * section,
while (1)
{
const char * name = *entries++;
if (!name)
break;

const char * value = *entries++;
if (!name || !value)
if (!value)
break;

ConfigOp op = {OP_SET_NO_FLAG, section, name, String(value)};
Expand Down

0 comments on commit b19b438

Please sign in to comment.