1 |
commit: 7aff0263204d80304108dbe4f0061f44ed8f189f |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 29 05:52:10 2016 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 29 05:52:10 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7aff0263 |
7 |
|
8 |
qlop: fix crash w/corrupted log files |
9 |
|
10 |
If a file is truncated/corrupted, make sure we don't read past the end |
11 |
of the valid buffer. |
12 |
|
13 |
URL: https://bugs.gentoo.org/573106 |
14 |
Reported-by: Agostino Sarubbo <ago <AT> gentoo.org> |
15 |
|
16 |
qlop.c | 3 +++ |
17 |
1 file changed, 3 insertions(+) |
18 |
|
19 |
diff --git a/qlop.c b/qlop.c |
20 |
index 546c353..bb32474 100644 |
21 |
--- a/qlop.c |
22 |
+++ b/qlop.c |
23 |
@@ -265,6 +265,9 @@ show_emerge_history(char listflag, int argc, char **argv, const char *logfile) |
24 |
continue; |
25 |
*p = 0; |
26 |
q = p + 3; |
27 |
+ /* Make sure there's leading white space and not a truncated string. #573106 */ |
28 |
+ if (p[1] != ' ' || p[2] != ' ') |
29 |
+ continue; |
30 |
|
31 |
t = (time_t) atol(buf); |