1 |
commit: 2706d0f789d2980bb8f82ab677957b1d32d0dfad |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 19 12:10:25 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 19 12:10:25 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=2706d0f7 |
7 |
|
8 |
qmanifest: fix Coverity 206565 Unchecked return value |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
qmanifest.c | 6 +++++- |
13 |
1 file changed, 5 insertions(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/qmanifest.c b/qmanifest.c |
16 |
index c1477cb..597357b 100644 |
17 |
--- a/qmanifest.c |
18 |
+++ b/qmanifest.c |
19 |
@@ -530,7 +530,11 @@ generate_dir(const char *dir, enum type_manifest mtype) |
20 |
"IGNORE timestamp.chk\n" |
21 |
"IGNORE timestamp.commit\n" |
22 |
"IGNORE timestamp.x\n"); |
23 |
- gzwrite(mf, path, len); |
24 |
+ if (gzwrite(mf, path, len) == 0) { |
25 |
+ fprintf(stderr, "failed to write to file '%s/%s': %s\n", |
26 |
+ dir, str_manifest_gz, strerror(errno)); |
27 |
+ return NULL; |
28 |
+ } |
29 |
} |
30 |
|
31 |
if (list_dir(&dentries, &dentrieslen, dir) != 0) |