commit | 28d03818df954f4f368ba98e340c068e4e97b603 | [log] [tgz] |
---|---|---|
author | Michal Vasko <mvasko@cesnet.cz> | Thu Mar 24 15:26:11 2022 +0100 |
committer | Michal Vasko <mvasko@cesnet.cz> | Thu Mar 24 15:26:11 2022 +0100 |
tree | e2d9c897b06940f8c3e97510cd94b19ee3805dc2 | |
parent | 1f9d98e496068a2436c0bc13cfd52418c637ddd0 [diff] [blame] |
tree schema UPDATE check for buffer overflow
diff --git a/src/tree_schema.c b/src/tree_schema.c index 1ac76bc..1f9fd69 100644 --- a/src/tree_schema.c +++ b/src/tree_schema.c
@@ -762,8 +762,12 @@ } else { len = asprintf(&path, "[%s='%%s']%s", key->name, s ? s : ""); } - free(s); + + if (buffer && (buflen <= (size_t)len)) { + /* not enough space in buffer */ + break; + } } }