summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2019-10-24 20:51:30 -0700
committerRuss Allbery <eagle@eyrie.org>2019-10-24 22:01:03 -0700
commit45437ef55ed4f27a89f52a1c518b5eb0eda3d25f (patch)
tree1815db3d1a9c45c2cab950f13dd34bc42f6cf96e /util
parent956950fcc2092cb17cb81216067ed2fea6819d93 (diff)
Fix cppcheck warnings
Lots of cppcheck fixes for new diagnostics in 1.89, plus some additional suppressions for one disagreement and a couple of apparent bugs.
Diffstat (limited to 'util')
-rw-r--r--util/buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/buffer.c b/util/buffer.c
index ee53176..57a679f 100644
--- a/util/buffer.c
+++ b/util/buffer.c
@@ -16,7 +16,7 @@
* which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2015-2016 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2015-2016, 2019 Russ Allbery <eagle@eyrie.org>
* Copyright 2011-2012, 2014
* The Board of Trustees of the Leland Stanford Junior University
* Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
@@ -43,6 +43,7 @@
#include <config.h>
#include <portable/system.h>
+#include <assert.h>
#include <errno.h>
#include <sys/stat.h>
@@ -111,6 +112,7 @@ void
buffer_set(struct buffer *buffer, const char *data, size_t length)
{
if (length > 0) {
+ assert(data != NULL);
buffer_resize(buffer, length);
memmove(buffer->data, data, length);
}