From 8d635de722da30c1b45b0791498fcf5b83684a2e Mon Sep 17 00:00:00 2001 From: "nelsonb%netscape.com" Date: Fri, 1 Nov 2002 21:04:33 +0000 Subject: [PATCH] Fix several problems related to error messages, including an attempt to print a null string pointer. --- security/nss/cmd/bltest/blapitest.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/security/nss/cmd/bltest/blapitest.c b/security/nss/cmd/bltest/blapitest.c index d13f3727690..887fedb116c 100644 --- a/security/nss/cmd/bltest/blapitest.c +++ b/security/nss/cmd/bltest/blapitest.c @@ -1807,13 +1807,13 @@ blapi_selftest(bltestCipherMode *modes, int numModes, int inoff, int outoff, mode = modes[i]; else mode = i; + if (mode == bltestINVALID) { + fprintf(stderr, "%s: Skipping invalid mode.\n",progName); + continue; + } modestr = mode_strings[mode]; cipherInfo.mode = mode; params = &cipherInfo.params; - if (mode == bltestINVALID) { - fprintf(stderr, "%s: Skipping invalid mode %s.\n",progName,modestr); - continue; - } #ifdef TRACK_BLTEST_BUG if (mode == bltestRSA) { fprintf(stderr, "[%s] Self-Testing RSA\n", __bltDBG); @@ -2089,6 +2089,8 @@ int main(int argc, char **argv) bltest.options = bltest_options; progName = strrchr(argv[0], '/'); + if (!progName) + progName = strrchr(argv[0], '\\'); progName = progName ? progName+1 : argv[0]; rv = RNG_RNGInit();