]> git.xonotic.org Git - xonotic/d0_blind_id.git/commitdiff
fix one possible NULL bug in d0_bignum-gmp
authorRudolf Polzer <divverent@xonotic.org>
Sun, 27 Nov 2011 13:15:18 +0000 (14:15 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 27 Nov 2011 13:15:18 +0000 (14:15 +0100)
d0_bignum-gmp.c

index 95b95e25aaf4c08164ef15f33cbacc576fc4b92e..d5da8b5889d64ee68e36febcc368d99487221952 100644 (file)
@@ -74,7 +74,8 @@ static void *reallocate_function (void *ptr, size_t old_size, size_t new_size)
        if(old_size == new_size)
                return ptr;
        data = d0_malloc(new_size);
-       memcpy(data, ptr, (old_size < new_size) ? old_size : new_size);
+       if(ptr && data)
+               memcpy(data, ptr, (old_size < new_size) ? old_size : new_size);
        d0_free(ptr);
        return data;
 }