summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvisa <>2017-12-01 14:42:23 +0000
committervisa <>2017-12-01 14:42:23 +0000
commitf0409c3cf441cd4fbcb4a68a09598bca8eeefb46 (patch)
tree82642923ae879a9e32aa41a62c7a9851a7f444f3 /src
parent7e9c5e1bdd0accb58b9e2ead152ef85403ea662b (diff)
downloadopenbsd-f0409c3cf441cd4fbcb4a68a09598bca8eeefb46.tar.gz
openbsd-f0409c3cf441cd4fbcb4a68a09598bca8eeefb46.tar.bz2
openbsd-f0409c3cf441cd4fbcb4a68a09598bca8eeefb46.zip
Avoid using an uninitialized variable.
Found by gcc. OK jca@
Diffstat (limited to 'src')
-rw-r--r--src/usr.sbin/ocspcheck/ocspcheck.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/usr.sbin/ocspcheck/ocspcheck.c b/src/usr.sbin/ocspcheck/ocspcheck.c
index 133401003e..551a8fa091 100644
--- a/src/usr.sbin/ocspcheck/ocspcheck.c
+++ b/src/usr.sbin/ocspcheck/ocspcheck.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocspcheck.c,v 1.23 2017/11/29 21:15:45 jmc Exp $ */ 1/* $OpenBSD: ocspcheck.c,v 1.24 2017/12/01 14:42:23 visa Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2017 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2017 Bob Beck <beck@openbsd.org>
@@ -632,6 +632,8 @@ main(int argc, char **argv)
632 if (!validate_response(hget->bodypart, hget->bodypartsz, 632 if (!validate_response(hget->bodypart, hget->bodypartsz,
633 request, castore, host, certfile)) 633 request, castore, host, certfile))
634 exit(1); 634 exit(1);
635 instaple = hget->bodypart;
636 instaplesz = hget->bodypartsz;
635 } else { 637 } else {
636 size_t nr = 0; 638 size_t nr = 0;
637 instaplesz = 0; 639 instaplesz = 0;
@@ -671,9 +673,9 @@ main(int argc, char **argv)
671 (void) ftruncate(staplefd, 0); 673 (void) ftruncate(staplefd, 0);
672 w = 0; 674 w = 0;
673 written = 0; 675 written = 0;
674 while (written < hget->bodypartsz) { 676 while (written < instaplesz) {
675 w = write(staplefd, hget->bodypart + written, 677 w = write(staplefd, instaple + written,
676 hget->bodypartsz - written); 678 instaplesz - written);
677 if (w == -1) { 679 if (w == -1) {
678 if (errno != EINTR && errno != EAGAIN) 680 if (errno != EINTR && errno != EAGAIN)
679 err(1, "Write of OCSP response failed"); 681 err(1, "Write of OCSP response failed");