diff options
-rw-r--r-- | toxcore/tox.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c index 191dd428..403ba83f 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -131,7 +131,7 @@ Tox *tox_new(const struct Tox_Options *options, const uint8_t *data, size_t leng | |||
131 | return NULL; | 131 | return NULL; |
132 | } | 132 | } |
133 | 133 | ||
134 | if (data) { | 134 | if (data && length) { |
135 | if (length < TOX_ENC_SAVE_MAGIC_LENGTH) { | 135 | if (length < TOX_ENC_SAVE_MAGIC_LENGTH) { |
136 | SET_ERROR_PARAMETER(error, TOX_ERR_NEW_LOAD_BAD_FORMAT); | 136 | SET_ERROR_PARAMETER(error, TOX_ERR_NEW_LOAD_BAD_FORMAT); |
137 | return NULL; | 137 | return NULL; |