mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
If length is 0, data should be ignored.
This commit is contained in:
parent
45858e2678
commit
7d061e8d57
|
@ -131,7 +131,7 @@ Tox *tox_new(const struct Tox_Options *options, const uint8_t *data, size_t leng
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data) {
|
if (data && length) {
|
||||||
if (length < TOX_ENC_SAVE_MAGIC_LENGTH) {
|
if (length < TOX_ENC_SAVE_MAGIC_LENGTH) {
|
||||||
SET_ERROR_PARAMETER(error, TOX_ERR_NEW_LOAD_BAD_FORMAT);
|
SET_ERROR_PARAMETER(error, TOX_ERR_NEW_LOAD_BAD_FORMAT);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user