summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2012-01-12 16:28:03 +0000
committerAndy Polyakov <appro@openssl.org>2012-01-12 16:28:03 +0000
commit9b2a29660bc3b9b7f2ee8df52f7d7a46e20247dc (patch)
treea283ea72cfe0109179b5cc52ade6e8546c18a01b /apps
parentb7b4a9fa5738bdc6a16a1702f48274b58bf2e7b4 (diff)
Sanitize usage of <ctype.h> functions. It's important that characters
are passed zero-extended, not sign-extended [from HEAD]. PR: 2682
Diffstat (limited to 'apps')
-rw-r--r--apps/ca.c2
-rw-r--r--apps/s_client.c2
-rw-r--r--apps/s_server.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 33e2391028..2a83d1936e 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -2560,7 +2560,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 b0702ce6fe..22e6762838 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 950ab67610..dbb35013de 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -1204,7 +1204,7 @@ int MAIN(int argc, char *argv[])
psk_key=*(++argv);
for (i=0; i<strlen(psk_key); i++)
{
- if (isxdigit((int)psk_key[i]))
+ if (isxdigit((unsigned char)psk_key[i]))
continue;
BIO_printf(bio_err,"Not a hex number '%s'\n",*argv);
goto bad;