Created
July 10, 2016 18:40
-
-
Save moyix/7117e2c29f3bf716e1047ceca5ffdc45 to your computer and use it in GitHub Desktop.
An example bug inserted by LAVA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char **argv) { | |
FILE *f = fopen(argv[1], "rb"); | |
file_header head; | |
parse_header(f, &head); | |
({ | |
int lava_77 = 0; | |
lava_77 |= ((unsigned char *) &((head).reserved))[0] << (0*8); | |
lava_77 |= ((unsigned char *) &((head).reserved))[1] << (1*8); | |
lava_77 |= ((unsigned char *) &((head).reserved))[2] << (2*8); | |
lava_77 |= ((unsigned char *) &((head).reserved))[3] << (3*8); | |
lava_set(77,lava_77); | |
int rv = printf("File timestamp: %u\n", head.timestamp); | |
rv; | |
}); | |
unsigned i; | |
for (i = 0; i < head.num_recs; i++) { | |
file_entry *ent = parse_record(f); | |
consume_record(ent+(lava_get(77))*(0x6c617614==(lava_get(77))||0x1476616c==(lava_get(77)))); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment