mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
tests: Make sure to pass right type to buffer_pack
For some reason, the mingw64 builds were failing on these inputs quite reliably as the passed value was interpretted as a value larger than UINT32_MAX. This was not caught before because the value is casted from size_t to uint32_t implicitly so the MSBs were not affecting the result. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -154,7 +154,7 @@ static void torture_ssh_buffer_add_format(void **state) {
|
|||||||
d=0xbadc0de;
|
d=0xbadc0de;
|
||||||
q=0x13243546acbdcedf;
|
q=0x13243546acbdcedf;
|
||||||
s=ssh_string_from_char("libssh");
|
s=ssh_string_from_char("libssh");
|
||||||
rc=ssh_buffer_pack(buffer, "bwdqSsPt",b,w,d,q,s,"rocks",7,"So much","Fun!");
|
rc=ssh_buffer_pack(buffer, "bwdqSsPt",b,w,d,q,s,"rocks",(size_t)7,"So much","Fun!");
|
||||||
assert_int_equal(rc, SSH_OK);
|
assert_int_equal(rc, SSH_OK);
|
||||||
|
|
||||||
len = ssh_buffer_get_len(buffer);
|
len = ssh_buffer_get_len(buffer);
|
||||||
|
@ -307,7 +307,7 @@ static void *thread_ssh_buffer_add_format(void *threadid)
|
|||||||
q,
|
q,
|
||||||
s,
|
s,
|
||||||
"rocks",
|
"rocks",
|
||||||
7,
|
(size_t)7,
|
||||||
"So much",
|
"So much",
|
||||||
"Fun!");
|
"Fun!");
|
||||||
assert_int_equal(rc, SSH_OK);
|
assert_int_equal(rc, SSH_OK);
|
||||||
|
Reference in New Issue
Block a user