]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Drop redundant non-negative checks on unsigned values
authorViktor Dukhovni <openssl-users@dukhovni.org>
Sat, 31 Aug 2024 02:27:33 +0000 (12:27 +1000)
committerTomas Mraz <tomas@openssl.org>
Thu, 5 Sep 2024 15:29:07 +0000 (17:29 +0200)
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25341)

(cherry picked from commit 8439337036bbfd940657b95e01e5bc08dc63d331)

test/bio_base64_test.c

index 0acb50503c810fd5b6a5954988b1dba4bfa894e2..9851aa63654c250cf62e57de4a12dde5c6b7a00d 100644 (file)
@@ -98,9 +98,6 @@ static int encode(unsigned const char *buf, unsigned buflen, char *encoded,
     int pos = 0;
     char nl = '\n';
 
-    if (buflen < 0)
-        return 0;
-
     /* Use a verbatim encoding when provided */
     if (encoded != NULL) {
         int elen = strlen(encoded);
@@ -317,7 +314,7 @@ static int generic_case(test_case *t, int verbose)
     int ok = 1;
 
     for (llen = linelengths; *llen > 0; ++llen) {
-        for (wscnt = wscnts; *wscnt >= 0 && *wscnt * 2 < *llen; ++wscnt) {
+        for (wscnt = wscnts; *wscnt * 2 < *llen; ++wscnt) {
             int extra = t->no_nl ? 64 : 0;
 
             /*