Skip to content

Commit fe3b639

Browse files
paulidalet8m
authored andcommitted
Fix CVE-2022-3602 in punycode decoder.
An off by one error in the punycode decoder allowed for a single unsigned int overwrite of a buffer which could cause a crash and possible code execution. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org>
1 parent 4bae06d commit fe3b639

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/punycode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int ossl_punycode_decode(const char *pEncoded, const size_t enc_len,
181181
n = n + i / (written_out + 1);
182182
i %= (written_out + 1);
183183

184-
if (written_out > max_out)
184+
if (written_out >= max_out)
185185
return 0;
186186

187187
memmove(pDecoded + i + 1, pDecoded + i,

0 commit comments

Comments
 (0)