diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-29 00:52:10 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-01-29 00:52:10 -0500 |
commit | 7aff0263204d80304108dbe4f0061f44ed8f189f (patch) | |
tree | 6fa4dfaa0bbf9ead25d25c4eb41361d6847a5d71 /qlop.c | |
parent | qcheck: improve error reporting for unreadable files (diff) | |
download | portage-utils-7aff0263204d80304108dbe4f0061f44ed8f189f.tar.gz portage-utils-7aff0263204d80304108dbe4f0061f44ed8f189f.tar.bz2 portage-utils-7aff0263204d80304108dbe4f0061f44ed8f189f.zip |
qlop: fix crash w/corrupted log files
If a file is truncated/corrupted, make sure we don't read past the end
of the valid buffer.
URL: https://bugs.gentoo.org/573106
Reported-by: Agostino Sarubbo <ago@gentoo.org>
Diffstat (limited to 'qlop.c')
-rw-r--r-- | qlop.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -265,6 +265,9 @@ show_emerge_history(char listflag, int argc, char **argv, const char *logfile) continue; *p = 0; q = p + 3; + /* Make sure there's leading white space and not a truncated string. #573106 */ + if (p[1] != ' ' || p[2] != ' ') + continue; t = (time_t) atol(buf); |