Skip to content

Fix buffer overflow when reading the IP from the settings - #310

Merged
aramg merged 1 commit into
dev47apps:masterfrom
Ritsj:fix/settings-ip-overflow
Oct 29, 2026
Merged

aramg merged 1 commit into
dev47apps:masterfrom
Ritsj:fix/settings-ip-overflow

Conversation

@Ritsj

@Ritsj Ritsj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Problem

settings->ip is a 16-byte buffer, but LoadSettings() reads it with %16s, which can store 16 characters plus the terminating NUL, one byte past the end of the buffer. A hand-edited or corrupted settings file with a 16+ character ip= value triggers it.

Fix

Use %15s, which still fits any IPv4 address (max 15 characters).

settings->ip is 16 bytes, but %16s can write 16 characters plus the
terminating NUL. Use %15s.
@aramg
aramg merged commit 74c31d5 into dev47apps:master Oct 29, 2026
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.

2 participants