diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2010-08-07 19:21:45 +0100 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2010-08-09 00:02:13 +0100 |
commit | 1afdab0f3d6adbd7ebbbf3bd7248651a924e6b68 (patch) | |
tree | 9031d9008ad0e9eb179be7941015fde67560ca48 /gdata/gdata-buffer.c | |
parent | 4f2db5a119f2e4a7a86ca3b9b72c9d085b5152bc (diff) | |
download | libgdata-1afdab0f3d6adbd7ebbbf3bd7248651a924e6b68.tar.gz |
[core] Fix potential use of NULL in memcpy()
Diffstat (limited to 'gdata/gdata-buffer.c')
-rw-r--r-- | gdata/gdata-buffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdata/gdata-buffer.c b/gdata/gdata-buffer.c index dc0ab83e..18f13955 100644 --- a/gdata/gdata-buffer.c +++ b/gdata/gdata-buffer.c @@ -135,7 +135,8 @@ gdata_buffer_push_data (GDataBuffer *self, const guint8 *data, gsize length) chunk->next = NULL; /* Copy the data to the chunk */ - memcpy (chunk->data, data, length); + if (G_LIKELY (data != NULL)) + memcpy (chunk->data, data, length); /* Add it to the buffer's tail */ if (self->tail != NULL) |