summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee1cd3f)
raw | patch | inline | side by side (parent: ee1cd3f)
author | Florian Forster <ff@octo.it> | |
Tue, 13 Sep 2016 18:52:58 +0000 (20:52 +0200) | ||
committer | GitHub <noreply@github.com> | |
Tue, 13 Sep 2016 18:52:58 +0000 (20:52 +0200) |
ssnprintf() ensures null termination, which is especially important when using "%s" in the format.
src/match_regex.c | patch | blob | history |
diff --git a/src/match_regex.c b/src/match_regex.c
index 5c75a6341b04c0f6fe3823af2de20c929aef1117..dd8319eae36fd42605826e738339ebdf6faf2d4c 100644 (file)
--- a/src/match_regex.c
+++ b/src/match_regex.c
llist_append (*meta, entry);
}
- snprintf (buffer, sizeof (buffer), "%s `%s'", ci->key, meta_key);
+ ssnprintf (buffer, sizeof (buffer), "%s `%s'", ci->key, meta_key);
/* Can't pass &entry->value into mr_add_regex, so copy in/out. */
re_head = entry->value;
status = mr_add_regex (&re_head, ci->values[1].value.string, buffer);