modesetting: Fix potential buffer overflow

If one misconfigures a ZaphodHeads value (more than 20 characters
without a delimiter), we get an overflow of our buffer.  Use
xstrtokenize() instead of writing/fixing our own tokenizer.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
Daniel Martin
2017-10-27 16:11:53 +02:00
committed by Adam Jackson
parent 2230e6c8af
commit 04a305121f
2 changed files with 14 additions and 26 deletions

View File

@@ -233,7 +233,7 @@ padding_for_int32(const int bytes)
}
extern char **xstrtokenize(const char *str, const char *separators);
extern _X_EXPORT char **xstrtokenize(const char *str, const char *separators);
extern void FormatInt64(int64_t num, char *string);
extern void FormatUInt64(uint64_t num, char *string);
extern void FormatUInt64Hex(uint64_t num, char *string);