Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
file: patch for CVE-2018-10360 (#43856)
from Gentoo, based on upstream commit. (cherry picked from commit 6546d17) It seems not clear if _this_ version was affected by the CVE, but the patch seems safe enough, so apply it to be sure.
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Avoid reading past the end of buffer | ||
|
||
CVE-2018-10360 | ||
|
||
https://github.com/file/file/commit/a642587a9c9e2dd7feacdf513c3643ce26ad3c22 | ||
|
||
--- a/src/readelf.c | ||
+++ b/src/readelf.c | ||
@@ -842,7 +842,8 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type, | ||
|
||
cname = (unsigned char *) | ||
&nbuf[doff + prpsoffsets(i)]; | ||
- for (cp = cname; *cp && isprint(*cp); cp++) | ||
+ for (cp = cname; cp < nbuf + size && *cp | ||
+ && isprint(*cp); cp++) | ||
continue; | ||
/* | ||
* Linux apparently appends a space at the end |