summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-12-16 04:54:37 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-12-17 21:57:55 +0000
commite5a2bdbc5501b892605a6a1fe7e30fb2f1546d42 (patch)
tree818bcbbb1116966182f46d67bff60d01ff12e359 /src
parent3ef14a241afc123560e9a50d17948b040481b299 (diff)
fix osmo_identifier_valid(): only allow printable characters
In particular disallow ASCII 0..31 (control characters) and 127 (DEL). Change-Id: I04469988495af03c881fe81d7786ca7f71636299
Diffstat (limited to 'src')
-rw-r--r--src/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index bc5329d8..8f56227e 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -444,6 +444,8 @@ bool osmo_identifier_valid(const char *str)
/* check for 7-bit ASCII */
if (str[i] & 0x80)
return false;
+ if (!isprint((int)str[i]))
+ return false;
/* check for some explicit reserved control characters */
if (strchr(illegal_chars, str[i]))
return false;