1
1

transport.c: fix use-of-uninitialized-value (#476)

file:transport.c

notes:
return error if malloc(0)

credit:
lutianxiong
Этот коммит содержится в:
lutianxiong 2020-05-29 01:25:40 +08:00 коммит произвёл GitHub
родитель 1105af5651
Коммит 642eec48ff
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -472,7 +472,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
/* Get a packet handle put data into. We get one to
hold all data, including padding and MAC. */
p->payload = LIBSSH2_ALLOC(session, total_num);
if(!p->payload) {
if(total_num == 0 || !p->payload) {
return LIBSSH2_ERROR_ALLOC;
}
p->total_num = total_num;