Browse Source

Avoid passing NULL argument to memcpy

ppa-0.6.1
practicalswift 7 years ago
committed by Rusty Russell
parent
commit
60a7720a24
  1. 2
      bitcoin/pullpush.c

2
bitcoin/pullpush.c

@ -1,5 +1,6 @@
#include "pullpush.h"
#include "varint.h"
#include <assert.h>
#include <ccan/endian/endian.h>
#include <ccan/mem/mem.h>
#include <ccan/tal/tal.h>
@ -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);

Loading…
Cancel
Save