1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

buffer: Make sure we do not use u32len uninitialized

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2016-01-19 11:09:06 +01:00
parent b1c0121507
commit 41a10699e6

View File

@@ -868,7 +868,6 @@ int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer,
void **data; void **data;
} o; } o;
size_t len, rlen; size_t len, rlen;
uint32_t u32len;
va_list ap_copy; va_list ap_copy;
int count; int count;
@@ -912,7 +911,9 @@ int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer,
rc = *o.string != NULL ? SSH_OK : SSH_ERROR; rc = *o.string != NULL ? SSH_OK : SSH_ERROR;
o.string = NULL; o.string = NULL;
break; break;
case 's': case 's': {
uint32_t u32len = 0;
o.cstring = va_arg(ap, char **); o.cstring = va_arg(ap, char **);
*o.cstring = NULL; *o.cstring = NULL;
rc = buffer_get_u32(buffer, &u32len); rc = buffer_get_u32(buffer, &u32len);
@@ -940,6 +941,7 @@ int ssh_buffer_unpack_va(struct ssh_buffer_struct *buffer,
o.cstring = NULL; o.cstring = NULL;
rc = SSH_OK; rc = SSH_OK;
break; break;
}
case 'P': case 'P':
len = va_arg(ap, size_t); len = va_arg(ap, size_t);