diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-07-16 11:38:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-07-16 11:38:39 -0400 |
commit | d32f5081e1c41324a3464c30c487c6ef57a333d1 (patch) | |
tree | 5d5ea967c21d07c15b4e2712608cf0a7b40fef8d /src/tools | |
parent | 9ad5b2593004c55d4223d59a150898b48d04737a (diff) | |
download | tor-d32f5081e1c41324a3464c30c487c6ef57a333d1.tar.gz tor-d32f5081e1c41324a3464c30c487c6ef57a333d1.zip |
Coverity 709056: Check return value on fputs in tor-gencert
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/tor-gencert.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c index a8ffc07796..38b2101a3c 100644 --- a/src/tools/tor-gencert.c +++ b/src/tools/tor-gencert.c @@ -497,7 +497,12 @@ generate_certificate(void) return 1; } - fputs(buf, f); + if (fputs(buf, f) < 0) { + log_err(LD_GENERAL, "Couldn't write to %s: %s", + certificate_file, strerror(errno)); + fclose(f); + return 1; + } fclose(f); return 0; } |