mirror of
https://github.com/paulusmack/ppp.git
synced 2024-11-23 18:33:24 +08:00
pppd: Make sure word read from options file is null-terminated
If a word read from an options file was longer than MAXWORDLEN, we could pass it to option_error() without null termination, which could have lead to an out-of-bounds access in vslprintf. Make sure word[] is null terminated in all cases. Reported-by: Florian Kohnhäuser <florian@kohnhaeuser.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
This commit is contained in:
parent
b311e98b1d
commit
c10c3c7cb3
@ -1357,6 +1357,7 @@ getword(f, word, newlinep, filename)
|
||||
|
||||
c = getc(f);
|
||||
}
|
||||
word[MAXWORDLEN-1] = 0; /* make sure word is null-terminated */
|
||||
|
||||
/*
|
||||
* End of the word: check for errors.
|
||||
|
Loading…
Reference in New Issue
Block a user