]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Filter: Fix zero arg handling
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 2 Jul 2026 15:21:50 +0000 (17:21 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 7 Jul 2026 19:17:33 +0000 (21:17 +0200)
memcpy() should not have NULL src arg

Reported-By: lzx0xf1@gmail.com
Target: patch

filter/filter.c

index f17de58c227b3b8992f85b1c7e6d84d12d03ca23..1c9b5dbcf04c8b18554b8888e000757444d56301 100644 (file)
@@ -170,7 +170,7 @@ interpret(struct filter_state *fs, const struct f_line *line, uint argc, const s
 
   /* Set the arguments and top-level variables */
   fstk->vcnt = line->vars + line->args;
-  memcpy(fstk->vstk, argv, sizeof(struct f_val) * line->args);
+  bmemcpy(fstk->vstk, argv, sizeof(struct f_val) * line->args);
   memset(fstk->vstk + line->args, 0, sizeof(struct f_val) * line->vars);
 
   /* The same as with the value stack. Not resetting the stack completely for performance reasons. */