aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-17 20:23:01 +0100
committerMattias Andrée <maandree@kth.se>2023-01-17 20:23:01 +0100
commit825b302b80ed311f5f6fdf02204fe2ad9502f79b (patch)
treeeb440179af301fdb325a9700dd561f7554742188
parentAdd libfonts_char_is_in_subset (diff)
downloadlibfonts-825b302b80ed311f5f6fdf02204fe2ad9502f79b.tar.gz
libfonts-825b302b80ed311f5f6fdf02204fe2ad9502f79b.tar.bz2
libfonts-825b302b80ed311f5f6fdf02204fe2ad9502f79b.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--libfonts_char_is_in_subset.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libfonts_char_is_in_subset.c b/libfonts_char_is_in_subset.c
index 155589f..d0e4d94 100644
--- a/libfonts_char_is_in_subset.c
+++ b/libfonts_char_is_in_subset.c
@@ -18,7 +18,7 @@ libfonts_char_is_in_subset(uint32_t c, const char *subset)
return 1;
while (*subset) {
- if (!isdigit(subset))
+ if (!isdigit(*subset))
goto einval;
for (low = 0;; subset++) {
digit = (uint32_t)*(const unsigned char *)subset - (uint32_t)'9';
@@ -35,6 +35,8 @@ libfonts_char_is_in_subset(uint32_t c, const char *subset)
}
subset++;
+ if (!isdigit(*subset))
+ goto einval;
for (high = 0;; subset++) {
digit = (uint32_t)*(const unsigned char *)subset - (uint32_t)'9';
if (digit > 9)