1 |
commit: 4bcd96dfe33a44dd90549510528db1310cfb1266 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 19 18:38:00 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 19 18:38:00 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=4bcd96df |
7 |
|
8 |
qlop: fix Coverity 206547 Out-of-bounds write |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
qlop.c | 2 +- |
13 |
1 file changed, 1 insertion(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/qlop.c b/qlop.c |
16 |
index 9fa1387..8c166e2 100644 |
17 |
--- a/qlop.c |
18 |
+++ b/qlop.c |
19 |
@@ -1129,7 +1129,7 @@ static array_t *probe_proc(array_t *atoms) |
20 |
continue; |
21 |
snprintf(npath, sizeof(npath), "/proc/%s/%s/%s", |
22 |
pid, subdir, d->d_name); |
23 |
- rpathlen = readlink(npath, rpath, sizeof(rpath)); |
24 |
+ rpathlen = readlink(npath, rpath, sizeof(rpath) - 1); |
25 |
if (rpathlen <= 0) |
26 |
continue; |
27 |
rpath[rpathlen] = '\0'; |