diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-20 14:03:40 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-02-20 18:52:17 +0100 |
commit | 944638f77c919baa4c06c8c2ced99dd3e2821514 (patch) | |
tree | 419003815e5f25ca818fbbdd26bac1161880084d /lib/str.c | |
parent | aa78a8c916d62a92d36be861e0433f00452688aa (diff) | |
download | gnutls-944638f77c919baa4c06c8c2ced99dd3e2821514.tar.gz |
eliminated various clang warnings with non-null arguments
That is, use assert() to ensure that known to be non-null
variables will be used as input to functions requiring non-null.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/str.c')
-rw-r--r-- | lib/str.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -110,6 +110,7 @@ void _gnutls_buffer_clear(gnutls_buffer_st * str) static void align_allocd_with_data(gnutls_buffer_st * dest) { + assert(dest->allocd != NULL); if (dest->length) memmove(dest->allocd, dest->data, dest->length); dest->data = dest->allocd; @@ -344,6 +345,8 @@ _gnutls_buffer_insert_data(gnutls_buffer_st * dest, int pos, if (ret < 0) return ret; + assert(dest->data != NULL); + memmove(&dest->data[pos + str_size], &dest->data[pos], orig_length - pos); |