Commit d32f5081 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Coverity 709056: Check return value on fputs in tor-gencert

parent 9ad5b259
Loading
Loading
Loading
Loading

changes/cov709056

0 → 100644
+4 −0
Original line number Diff line number Diff line
  o Minor bugfixes:
    - Check return value of fputs() when writing authority certificate
      file. Fixes Coverity issue 709056; bugfix on 0.2.0.1-alpha.
+6 −1
Original line number Diff line number Diff line
@@ -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;
}