mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-18 17:02:01 +00:00
Bug 136804: initialize inFile to PR_STDIN instead of NULL so that we don't
crash if the -i option is not specified. Added two assertions to avoid closing PR_STDIN due to internal errors.
This commit is contained in:
parent
70f20ae10a
commit
5a3d303bc9
@ -2161,7 +2161,7 @@ main(int argc, char **argv)
|
||||
CERTCertDBHandle *certHandle;
|
||||
PK11SlotInfo *slot = NULL;
|
||||
CERTName * subject = 0;
|
||||
PRFileDesc *inFile = 0;
|
||||
PRFileDesc *inFile = PR_STDIN;
|
||||
PRFileDesc *outFile = 0;
|
||||
char * certfile = "tempcert";
|
||||
char * certreqfile = "tempcertreq";
|
||||
@ -2693,6 +2693,7 @@ main(int argc, char **argv)
|
||||
*/
|
||||
|
||||
if (certutil.commands[cmd_CreateAndAddCert].activated) {
|
||||
PORT_Assert(inFile != PR_STDIN);
|
||||
PR_Close(inFile);
|
||||
PR_Close(outFile);
|
||||
inFile = PR_Open(certfile, PR_RDONLY, 0);
|
||||
@ -2717,6 +2718,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (certutil.commands[cmd_CreateAndAddCert].activated) {
|
||||
PORT_Assert(inFile != PR_STDIN);
|
||||
PR_Close(inFile);
|
||||
PR_Delete(certfile);
|
||||
PR_Delete(certreqfile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user