diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-12-01 14:42:24 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-12-01 14:42:24 +0000 |
commit | f5e0a0f5ed38e1f9ec48836d9bbbdd8265cb1226 (patch) | |
tree | 138527700d6e73ebfc1306b21ec8a069c39bd3dd /usr.sbin | |
parent | 09fd64a22376341823e48f9d1616bf7b02948155 (diff) |
Avoid using an uninitialized variable.
Found by gcc.
OK jca@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ocspcheck/ocspcheck.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/ocspcheck/ocspcheck.c b/usr.sbin/ocspcheck/ocspcheck.c index 133401003e5..551a8fa091f 100644 --- a/usr.sbin/ocspcheck/ocspcheck.c +++ b/usr.sbin/ocspcheck/ocspcheck.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocspcheck.c,v 1.23 2017/11/29 21:15:45 jmc Exp $ */ +/* $OpenBSD: ocspcheck.c,v 1.24 2017/12/01 14:42:23 visa Exp $ */ /* * Copyright (c) 2017 Bob Beck <beck@openbsd.org> @@ -632,6 +632,8 @@ main(int argc, char **argv) if (!validate_response(hget->bodypart, hget->bodypartsz, request, castore, host, certfile)) exit(1); + instaple = hget->bodypart; + instaplesz = hget->bodypartsz; } else { size_t nr = 0; instaplesz = 0; @@ -671,9 +673,9 @@ main(int argc, char **argv) (void) ftruncate(staplefd, 0); w = 0; written = 0; - while (written < hget->bodypartsz) { - w = write(staplefd, hget->bodypart + written, - hget->bodypartsz - written); + while (written < instaplesz) { + w = write(staplefd, instaple + written, + instaplesz - written); if (w == -1) { if (errno != EINTR && errno != EAGAIN) err(1, "Write of OCSP response failed"); |