Skip to content

Commit

Permalink
Range 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
DesWurstes committed Jun 17, 2018
1 parent 490a88c commit 1b6e31c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,17 +433,18 @@ int vg_read_range_file(
}
char *buff2 = (char *) malloc(40 * sizeof(char));
for (int i = 0; i < 80; i += 2) {
buff2[i / 2] = decodeHex(buff[i]) * 16 +
decodeHex(buff[i + 1]);
char k1 = decodeHex(buff[i]);
char k2 = decodeHex(buff[i + 1]);
if (k1 == -1 || k2 == -1) goto nonb32;
buff2[i / 2] = k1 * 16 + k2;
}
for (int i = 0; i < 40; i++) {
if (buff2[i] == -1) {
fprintf(stderr,
"Non-lowercase-base16 character in line that starts with \"%.15s...\"\n",
buff);
free(buff);
return 0;
}
if (0) {
nonb32:
fprintf(stderr,
"Non-lowercase-base16 character in line that starts with \"%.15s...\"\n",
buff);
free(buff);
return 0;
}
(*pat_list)[(*pat_count)++] = (const char *) buff2;
}
Expand Down

0 comments on commit 1b6e31c

Please sign in to comment.