Fix a couple of signedness compiler warnings, presumably due to me
[u/mdw/putty] / ssh.c
diff --git a/ssh.c b/ssh.c
index 21fcd2d..5196b1b 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -1424,6 +1424,7 @@ static int s_wrpkt_prepare(Ssh ssh, struct Packet *pkt, int *offset_p)
        zlib_compress_block(ssh->cs_comp_ctx,
                            pkt->data + 12, pkt->length - 12,
                            &compblk, &complen);
+       ssh_pkt_ensure(pkt, complen + 2);   /* just in case it's got bigger */
        memcpy(pkt->data + 12, compblk, complen);
        sfree(compblk);
        pkt->length = complen + 12;
@@ -5755,7 +5756,7 @@ static int do_ssh2_transport(Ssh ssh, void *vin, int inlen,
              */
             s->pktout = ssh2_pkt_init(SSH2_MSG_KEXRSA_SECRET);
             ssh2_pkt_addstring_start(s->pktout);
-            ssh2_pkt_addstring_data(s->pktout, outstr, outstrlen);
+            ssh2_pkt_addstring_data(s->pktout, (char *)outstr, outstrlen);
             ssh2_pkt_send_noqueue(ssh, s->pktout);
 
            hash_string(ssh->kex->hash, ssh->exhash, outstr, outstrlen);