diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-09-27 15:07:04 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-10-10 18:09:00 +0200 |
commit | 98b4762ca9707156102ba075c089acc659d60fbb (patch) | |
tree | d0feafbd6e85089aec91eb3774d35c08bcd7dfcf | |
parent | 4de462da4d029aff330966e4158e1bffaeb743fd (diff) | |
download | gnutls-98b4762ca9707156102ba075c089acc659d60fbb.tar.gz |
str: use assert to mark impossible cases
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/str.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -99,6 +99,7 @@ void _gnutls_buffer_clear(gnutls_buffer_st * str) static void align_allocd_with_data(gnutls_buffer_st * dest) { assert(dest->allocd != NULL); + assert(dest->data != NULL); if (dest->length) memmove(dest->allocd, dest->data, dest->length); dest->data = dest->allocd; @@ -154,6 +155,7 @@ gnutls_buffer_append_data(gnutls_buffer_t dest, const void *data, align_allocd_with_data(dest); } + assert(dest->data != NULL); memcpy(&dest->data[dest->length], data, data_size); dest->length = tot_len; |