HomePhabricator

buffer: Convert argc to size_t in ssh_buffer_unpack() as well

Authored by Baruch Siach <baruch@tkos.co.il> on Jan 22 2019, 12:31 PM.

Description

buffer: Convert argc to size_t in ssh_buffer_unpack() as well

Commit c306a693f3fb ("buffer: Use size_t for argc argument in
ssh_buffer_(un)pack()") mentioned unpack in the commit log, but it only
touches the pack variants. Extend the conversion to unpack.

Pre-initialize the p pointer to avoid possible use before
initialization in case of early argc check failure.

This fixes build failure:

.../libssh-0.8.6/src/buffer.c: In function 'ssh_buffer_unpack_va':
.../libssh-0.8.6/src/buffer.c:1229:16: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]

             if (argc == -1){
		^

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>

Details

Committed
asnJan 24 2019, 5:48 PM
Parents
rLIBSSH83d86ef6a5d0: examples: add public key auth for specific key
Branches
Unknown
Tags
Unknown

Event Timeline