mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bugzilla Bug 345941: fixed the bug that we might pass uninitialized 'req'
to fclose(). r=glen.beasley. Thanks to Wolfgang Rosenauer <mozilla@rosenauer.org> for the bug report.
This commit is contained in:
parent
664ced1b24
commit
97881e483f
@ -3088,8 +3088,8 @@ void hmac_test(char *reqfn)
|
||||
unsigned char HMAC[HASH_LENGTH_MAX]; /* computed HMAC */
|
||||
HASH_HashType hash_alg; /* HMAC type */
|
||||
|
||||
FILE *req; /* input stream from the REQUEST file */
|
||||
FILE *resp; /* output stream to the RESPONSE file */
|
||||
FILE *req = NULL; /* input stream from the REQUEST file */
|
||||
FILE *resp; /* output stream to the RESPONSE file */
|
||||
|
||||
buf = PORT_ZAlloc(bufSize);
|
||||
if (buf == NULL) {
|
||||
@ -3201,7 +3201,9 @@ void hmac_test(char *reqfn)
|
||||
}
|
||||
}
|
||||
loser:
|
||||
fclose(req);
|
||||
if (req) {
|
||||
fclose(req);
|
||||
}
|
||||
if (buf) {
|
||||
PORT_ZFree(buf, bufSize);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user