From: Andy Polyakov Date: Thu, 12 Jan 2012 16:21:35 +0000 (+0000) Subject: Sanitize usage of functions. It's important that characters X-Git-Tag: master-post-reformat~1985 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a50bce82ecccdfac135aeefe3d4ad9713829f477;p=oweals%2Fopenssl.git Sanitize usage of functions. It's important that characters are passed zero-extended, not sign-extended. PR: 2682 --- diff --git a/apps/ca.c b/apps/ca.c index de3122b7ec..1cf50e0029 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -2561,7 +2561,7 @@ static int get_certificate_status(const char *serial, CA_DB *db) /* Make it Upper Case */ for (i=0; row[DB_serial][i] != '\0'; i++) - row[DB_serial][i] = toupper(row[DB_serial][i]); + row[DB_serial][i] = toupper((unsigned char)row[DB_serial][i]); ok=1; diff --git a/apps/s_client.c b/apps/s_client.c index 84ba86e945..dbc0700ded 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -763,7 +763,7 @@ int MAIN(int argc, char **argv) psk_key=*(++argv); for (j = 0; j < strlen(psk_key); j++) { - if (isxdigit((int)psk_key[j])) + if (isxdigit((unsigned char)psk_key[j])) continue; BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); goto bad; diff --git a/apps/s_server.c b/apps/s_server.c index 961077c36f..92bd28b8e3 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1219,7 +1219,7 @@ int MAIN(int argc, char *argv[]) psk_key=*(++argv); for (i=0; i