Subject: win32 buid issue

win32 buid issue

From: Grubsky Grigory <g.grubsky_at_securitycode.ru>
Date: Sun, 23 May 2010 03:22:17 +0400

Hi everyone,

I would like to offer some patches.

1. VC swears at uint8_t (libssh2_priv.h line 492)
8<------------------------------------------------------
--- 00/libssh2_priv.h 2010-04-30 08:06:04 +0400
+++ 01/libssh2_priv.h 2010-05-23 03:06:34 +0400
@@ -41,6 +41,7 @@
 #define LIBSSH2_PRIV_H 1
 
 #ifdef _WIN32
+ typedef unsigned __int8 uint8_t;
   #ifndef _CRT_SECURE_NO_DEPRECATE
     #define _CRT_SECURE_NO_DEPRECATE 1
   #endif /* _CRT_SECURE_NO_DEPRECATE */
8<------------------------------------------------------

2. Incorrect _libssh2_store_str call (agent.c line 288)
8<------------------------------------------------------
--- 00/agent.c 2010-04-26 08:06:04 +0400
+++ 01/agent.c 2010-05-23 03:03:02 +0400
@@ -268,6 +268,7 @@
     char mapname[23];
     HANDLE filemap;
     unsigned char *p;
+ unsigned char *pbuff;
     int id;
     COPYDATASTRUCT cds;
 
@@ -285,7 +286,8 @@
        return -1;
     }
     p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0);
- _libssh2_store_str(p, transctx->request, transctx->request_len);
+ pbuff = p;
+ _libssh2_store_str(&pbuff, transctx->request, transctx->request_len);
 
     cds.dwData = PAGEANT_COPYDATA_ID;
     cds.cbData = 1 + strlen(mapname);
8<------------------------------------------------------

Am I right?

Regards,
Grigory
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-05-24