From: tb Date: Sun, 23 Apr 2023 11:25:21 +0000 (+0000) Subject: Initialize ishex and isneg at the top and drop some elses X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9015b48bfe3bb5d1bfbcc2e0c20293a43f6288be;p=openbsd Initialize ishex and isneg at the top and drop some elses --- diff --git a/lib/libcrypto/x509/x509_utl.c b/lib/libcrypto/x509/x509_utl.c index b6f1919b39f..f7b9c8586d5 100644 --- a/lib/libcrypto/x509/x509_utl.c +++ b/lib/libcrypto/x509/x509_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_utl.c,v 1.10 2023/04/23 10:19:52 tb Exp $ */ +/* $OpenBSD: x509_utl.c,v 1.11 2023/04/23 11:25:21 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -241,7 +241,7 @@ s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value) { BIGNUM *bn = NULL; ASN1_INTEGER *aint; - int isneg, ishex; + int isneg = 0, ishex = 0; int ret; if (!value) { @@ -252,14 +252,12 @@ s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value) if (value[0] == '-') { value++; isneg = 1; - } else - isneg = 0; + } if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) { value += 2; ishex = 1; - } else - ishex = 0; + } if (ishex) ret = BN_hex2bn(&bn, value);