# HG changeset patch # User Matt Johnston # Date 1385392113 -28800 # Node ID 30ab30e46452e9753dc9d63c31749ba2828c2663 # Parent 14342451d3df0968c6c7dae40d325bc5f587000b Fix some warnings diff -r 14342451d3df -r 30ab30e46452 cli-agentfwd.c --- a/cli-agentfwd.c Thu Nov 14 22:39:27 2013 +0800 +++ b/cli-agentfwd.c Mon Nov 25 23:08:33 2013 +0800 @@ -201,7 +201,7 @@ num = buf_getint(inbuf); for (i = 0; i < num; i++) { sign_key * pubkey = NULL; - int key_type = DROPBEAR_SIGNKEY_ANY; + enum signkey_type key_type = DROPBEAR_SIGNKEY_ANY; buffer * key_buf; /* each public key is encoded as a string */ diff -r 14342451d3df -r 30ab30e46452 configure.ac --- a/configure.ac Thu Nov 14 22:39:27 2013 +0800 +++ b/configure.ac Mon Nov 25 23:08:33 2013 +0800 @@ -21,7 +21,7 @@ if test -z "$OLDCFLAGS" && test "$GCC" = "yes"; then AC_MSG_NOTICE(No \$CFLAGS set... using "-Os -W -Wall" for GCC) - CFLAGS="-Os -W -Wall" + CFLAGS="-Os -W -Wall -Wno-pointer-sign" fi # large file support is useful for scp diff -r 14342451d3df -r 30ab30e46452 dbutil.c --- a/dbutil.c Thu Nov 14 22:39:27 2013 +0800 +++ b/dbutil.c Mon Nov 25 23:08:33 2013 +0800 @@ -881,14 +881,17 @@ /* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE, with the result in *val */ int m_str_to_uint(const char* str, unsigned int *val) { + unsigned long l; errno = 0; - *val = strtoul(str, NULL, 10); + l = strtoul(str, NULL, 10); /* The c99 spec doesn't actually seem to define EINVAL, but most platforms * I've looked at mention it in their manpage */ - if ((*val == 0 && errno == EINVAL) - || (*val == ULONG_MAX && errno == ERANGE)) { + if ((l == 0 && errno == EINVAL) + || (l == ULONG_MAX && errno == ERANGE) + || (l > UINT_MAX)) { return DROPBEAR_FAILURE; } else { + *val = l; return DROPBEAR_SUCCESS; } } diff -r 14342451d3df -r 30ab30e46452 ecc.c --- a/ecc.c Thu Nov 14 22:39:27 2013 +0800 +++ b/ecc.c Mon Nov 25 23:08:33 2013 +0800 @@ -75,8 +75,8 @@ ecc_key * new_ecc_key(void) { ecc_key *key = m_malloc(sizeof(*key)); - m_mp_alloc_init_multi(&key->pubkey.x, &key->pubkey.y, - &key->pubkey.z, &key->k, NULL); + m_mp_alloc_init_multi((mp_int**)&key->pubkey.x, (mp_int**)&key->pubkey.y, + (mp_int**)&key->pubkey.z, (mp_int**)&key->k, NULL); return key; } diff -r 14342451d3df -r 30ab30e46452 signkey.c --- a/signkey.c Thu Nov 14 22:39:27 2013 +0800 +++ b/signkey.c Mon Nov 25 23:08:33 2013 +0800 @@ -508,14 +508,13 @@ * signature blob */ int buf_verify(buffer * buf, sign_key *key, buffer *data_buf) { - unsigned int bloblen; unsigned char * type_name = NULL; unsigned int type_name_len = 0; enum signkey_type type; TRACE(("enter buf_verify")) - bloblen = buf_getint(buf); + buf_getint(buf); /* blob length */ type_name = buf_getstring(buf, &type_name_len); type = signkey_type_from_name(type_name, type_name_len); m_free(type_name);