From 60a7720a2498b66e31b27c525592719d9f39f897 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 5 Mar 2018 17:46:14 +0100 Subject: [PATCH] Avoid passing NULL argument to memcpy --- bitcoin/pullpush.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bitcoin/pullpush.c b/bitcoin/pullpush.c index a112b6c5c..23722aa88 100644 --- a/bitcoin/pullpush.c +++ b/bitcoin/pullpush.c @@ -1,5 +1,6 @@ #include "pullpush.h" #include "varint.h" +#include #include #include #include @@ -58,6 +59,7 @@ const u8 *pull(const u8 **cursor, size_t *max, void *copy, size_t n) } *cursor += n; *max -= n; + assert(p); if (copy) memcpy(copy, p, n); return memcheck(p, n);