Bugzilla Bug 298409: fixed an array index off-by-one error and a memory

leak. r=nelsonb.
This commit is contained in:
wtchang%redhat.com 2005-06-24 23:00:02 +00:00
parent efdb7c74c9
commit 47bf55ca0f

View File

@ -1367,7 +1367,7 @@ crlgen_setNextDataFn_extension(CRLGENGeneratorData *crlGenData, void *str,
return SECFailure;
}
}
if (extStr->nextUpdatedData > MAX_EXT_DATA_LENGTH) {
if (extStr->nextUpdatedData >= MAX_EXT_DATA_LENGTH) {
PORT_SetError(SEC_ERROR_INVALID_ARGS);
crlgen_PrintError(crlGenData->parsedLineNum,
"number of fields in extension "
@ -1415,7 +1415,7 @@ crlgen_destroyTempData(CRLGENGeneratorData *crlGenData)
PORT_Free(crlGenData->certEntry);
break;
case CRLGEN_ADD_EXTENSION_CONTEXT:
if (crlGenData->extensionEntry->nextUpdatedData) {
if (crlGenData->extensionEntry->extData) {
int i = 0;
for (;i < crlGenData->extensionEntry->nextUpdatedData;i++)
PORT_Free(*(crlGenData->extensionEntry->extData + i));