]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - samples/seccomp/bpf-helper.c
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / samples / seccomp / bpf-helper.c
index 579cfe3318862f360cc45cd440db633e6c6f0664..05cb4d5ff9f5bef632baa98eb687f1781dcb5e5e 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "bpf-helper.h"
@@ -63,6 +64,11 @@ __u32 seccomp_bpf_label(struct bpf_labels *labels, const char *label)
 {
        struct __bpf_label *begin = labels->labels, *end;
        int id;
+
+       if (labels->count == BPF_LABELS_MAX) {
+               fprintf(stderr, "Too many labels\n");
+               exit(1);
+       }
        if (labels->count == 0) {
                begin->label = label;
                begin->location = 0xffffffff;