diff --git a/helsing/src/main.c b/helsing/src/main.c index dc55fdb..f0028c6 100644 --- a/helsing/src/main.c +++ b/helsing/src/main.c @@ -47,6 +47,8 @@ int main(int argc, char *argv[]) goto out; pthread_t *threads = malloc(sizeof(pthread_t) * options.threads); + if (threads == NULL) + abort(); struct targs_handle *thhandle = NULL; targs_handle_new(&thhandle, options, interval.min, interval.max, progress); diff --git a/helsing/src/vampire/vargs.c b/helsing/src/vampire/vargs.c index 7823422..e9ebb11 100644 --- a/helsing/src/vampire/vargs.c +++ b/helsing/src/vampire/vargs.c @@ -189,6 +189,9 @@ void vampire(vamp_t min, vamp_t max, struct vargs *args, fang_t fmax) multiplicand++; if (multiplicand <= multiplicand_max) { + /* + * If multiplier has n digits, then product_iterator has at most n+1 digits. + */ vamp_t product_iterator = multiplier; product_iterator *= BASE - 1; // <= (BASE-1) * (2^32) vamp_t product = multiplier;