summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-08 22:09:57 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-08 22:09:57 +0100
commit34a8189a00c1eb3d76d62d4ba188d9785538222d (patch)
tree05e179616fc1ee2a09cc0f643e1bb716bc42f23b /src
parent5874b0f2444072b86b34ce50f12d0c37dc635ae6 (diff)
Fix one potential OOB read when parsing the config file
Diffstat (limited to 'src')
-rw-r--r--src/ot_config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ot_config.c b/src/ot_config.c
index 626ddea..a4c2a47 100644
--- a/src/ot_config.c
+++ b/src/ot_config.c
@@ -79,10 +79,12 @@ static listen_option_kind parse_listen_option(char **p) {
79 79
80 for (i = 0; i < listen_option_count; ++i) { 80 for (i = 0; i < listen_option_count; ++i) {
81 const listen_option_key *key = &listen_option_keys[i]; 81 const listen_option_key *key = &listen_option_keys[i];
82 char delimiter = (*p)[key->len]; 82 char delimiter;
83 83
84 if (strncmp(*p, key->name, key->len)) 84 if (strncmp(*p, key->name, key->len))
85 continue; 85 continue;
86 /* The match guarantees *p is at least key->len bytes, so this is in bounds */
87 delimiter = (*p)[key->len];
86 if (key->takes_value ? delimiter != '=' : (delimiter && !isspace((unsigned char)delimiter))) 88 if (key->takes_value ? delimiter != '=' : (delimiter && !isspace((unsigned char)delimiter)))
87 continue; 89 continue;
88 90