]> jfr.im git - solanum.git/commitdiff
filter: require an extra "+" before data
authorEd Kellett <redacted>
Wed, 3 Apr 2019 11:16:44 +0000 (12:16 +0100)
committerEd Kellett <redacted>
Sun, 6 Oct 2019 18:24:33 +0000 (19:24 +0100)
This disambiguates it from control commands

extensions/filter.c

index 1cb278294748aabf9399ebacc2940f957cc29e27..cf7907c24e2da915eea11f388e9e9fddf5ba87e3 100644 (file)
@@ -196,6 +196,13 @@ setfilter(const char *check, const char *data, const char **error)
                return 0;
        }
 
+       if (*data != '+') {
+               if (error) *error = "unknown command or data doesn't start with +";
+               return -1;
+       }
+
+       data += 1;
+
        if (state == FILTER_FILLING) {
                int dl;
                unsigned char *d = rb_base64_decode(data, strlen(data), &dl);