This commit is contained in:
irungentoo 2015-03-25 20:37:56 -04:00
commit 2cafa4a089
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -131,7 +131,7 @@ Tox *tox_new(const struct Tox_Options *options, const uint8_t *data, size_t leng
return NULL;
}
if (data) {
if (data && length) {
if (length < TOX_ENC_SAVE_MAGIC_LENGTH) {
SET_ERROR_PARAMETER(error, TOX_ERR_NEW_LOAD_BAD_FORMAT);
return NULL;