Check bounds

This commit is contained in:
Juliusz Sosinowicz
2019-10-29 12:08:47 +01:00
parent ea5ac675ed
commit d9ab0c4bcb

View File

@@ -39554,7 +39554,7 @@ int wolfSSL_X509_NAME_print_ex(WOLFSSL_BIO* bio, WOLFSSL_X509_NAME* name,
} }
totalSz += tmpSz; totalSz += tmpSz;
} }
if (fullName[totalSz-1] == '\0') if (totalSz > 0 && fullName[totalSz-1] == '\0')
totalSz--; totalSz--;
if (wolfSSL_BIO_write(bio, fullName, totalSz) != totalSz) if (wolfSSL_BIO_write(bio, fullName, totalSz) != totalSz)
return WOLFSSL_FAILURE; return WOLFSSL_FAILURE;