From: Richard Levitte Date: Wed, 30 Dec 2015 15:57:05 +0000 (+0100) Subject: Fix faulty check in the VMS version of opt_progname X-Git-Tag: OpenSSL_1_1_0-pre2~140 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=211a68b41a0dd3fed01ac9c93e495fdc03bd1e92;p=oweals%2Fopenssl.git Fix faulty check in the VMS version of opt_progname Reviewed-by: Stephen Henson --- diff --git a/apps/opt.c b/apps/opt.c index 90a9d84e47..853c981ce6 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -127,7 +127,7 @@ char *opt_progname(const char *argv0) q = strrchr(p, '.'); strncpy(prog, p, sizeof prog - 1); prog[sizeof prog - 1] = '\0'; - if (q == NULL || q - p >= sizeof prog) + if (q != NULL && q - p < sizeof prog) prog[q - p] = '\0'; return prog; }