Error when fetching tags and direction isn't 1 or -1
authorChip Black <bytex64@bytex64.net>
Mon, 29 Apr 2013 07:07:52 +0000 (02:07 -0500)
committerChip Black <bytex64@bytex64.net>
Mon, 29 Apr 2013 07:07:52 +0000 (02:07 -0500)
database/tags.c

index dc6bac8..0d7a27f 100644 (file)
@@ -106,6 +106,11 @@ struct blergref * tag_list(const char *tag, uint64_t offset, int *count, int dir
 
        if (!valid_tag_name(tag + 1))
                return NULL;
+
+       if (!(direction == 1 || direction == -1)) {
+               fprintf(stderr, "Invalid direction: %d\n", direction);
+               return NULL;
+       }
        
        switch(tag[0]) {
        case '#':