aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/strbuf.c b/strbuf.c
index e2b8d689..e4dfb803 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -114,6 +114,11 @@ int strbuf_init_copy(strbuf* dest, strbuf* src) {
ERR("Dest already allocated");
return 1;
}
+
+ if (src == NULL) {
+ ERR("Attempting to copy NULL strbuf");
+ return 2;
+ }
#endif
CONSTRUCT(strbuf, dest, src->len + 1);