mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
devmatch: Catch truncated linker hints files
PR: 282268 Reviewed by: christos, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47243 (cherry picked from commit 9b2f2fbfcbc51f77e96a41e62b1c06a8ccd4ca15)
This commit is contained in:
parent
bf2145f361
commit
4990a7d344
1 changed files with 6 additions and 0 deletions
|
|
@ -127,6 +127,12 @@ read_linker_hints(void)
|
|||
err(1, "Can't open %s for reading", fn);
|
||||
}
|
||||
|
||||
if (len < sizeof(int)) {
|
||||
warnx("Linker hints file too short.");
|
||||
free(hints);
|
||||
hints = NULL;
|
||||
return;
|
||||
}
|
||||
if (*(int *)(intptr_t)hints != LINKER_HINTS_VERSION) {
|
||||
warnx("Linker hints version %d doesn't match expected %d.",
|
||||
*(int *)(intptr_t)hints, LINKER_HINTS_VERSION);
|
||||
|
|
|
|||
Loading…
Reference in a new issue