Commit 70327993 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

When makekeys fails to find a good hash, print error instead of divide-by-zero

parent f5736540
......@@ -150,6 +150,11 @@ next1: ;
}
z = best_z;
if (z == 0) {
fprintf(stderr, "makekeys: failed to find small enough hash!\n"
"Try increasing KTNUM in makekeys.c\n");
exit(1);
}
printf("#ifdef NEEDKTABLE\n");
printf("const unsigned char _XkeyTable[] = {\n");
printf("0,\n");
......@@ -230,6 +235,11 @@ next2: ;
}
z = best_z;
if (z == 0) {
fprintf(stderr, "makekeys: failed to find small enough hash!\n"
"Try increasing KTNUM in makekeys.c\n");
exit(1);
}
for (i = z; --i >= 0;)
offsets[i] = 0;
for (i = 0; i < ksnum; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment