Unverified Commit 03e237e0 authored by Pascal Bühler's avatar Pascal Bühler Committed by GitHub

Merge pull request #390 from pabuhler/coverity-scan-179781

bitvector of length zero is not valid
parents 8f385173 b44764bf
......@@ -328,9 +328,11 @@ int bitvector_alloc(bitvector_t *v, unsigned long length)
l = length / bits_per_word * bytes_per_word;
/* allocate memory, then set parameters */
if (l == 0)
if (l == 0) {
v->word = NULL;
else {
v->length = 0;
return -1;
} else {
v->word = (uint32_t *)srtp_crypto_alloc(l);
if (v->word == NULL) {
v->length = 0;
......
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