mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Coverity 709056: Check return value on fputs in tor-gencert
This commit is contained in:
parent
9ad5b25930
commit
d32f5081e1
4
changes/cov709056
Normal file
4
changes/cov709056
Normal file
@ -0,0 +1,4 @@
|
||||
o Minor bugfixes:
|
||||
- Check return value of fputs() when writing authority certificate
|
||||
file. Fixes Coverity issue 709056; bugfix on 0.2.0.1-alpha.
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user