summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-09-11 16:52:24 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-11 16:52:24 -0400
commit64521a9d355da9f21d81c8a82056e544372685b2 (patch)
treea3ce5b736e41db284f4ae2b5a925ac5195c77acf
parent77e2be06f6ff9c7328144fe5df3e3bac64106449 (diff)
parent25513ae174d80a62ca0a8dcca52683089be95ea3 (diff)
downloadtor-64521a9d355da9f21d81c8a82056e544372685b2.tar.gz
tor-64521a9d355da9f21d81c8a82056e544372685b2.zip
Merge remote-tracking branch 'public/solaris_warnings_028'
-rw-r--r--src/common/address.c1
-rw-r--r--src/common/crypto.h2
-rw-r--r--src/common/util.c4
-rw-r--r--src/ext/ed25519/donna/ed25519_tor.c2
-rw-r--r--src/ext/ed25519/ref10/keypair.c3
-rw-r--r--src/ext/ed25519/ref10/open.c3
-rw-r--r--src/ext/trunnel/trunnel-impl.h8
-rw-r--r--src/ext/trunnel/trunnel.c4
-rw-r--r--src/ext/trunnel/trunnel.h2
-rw-r--r--src/or/circuitmux_ewma.c2
-rw-r--r--src/test/test-child.c2
-rw-r--r--src/test/test-memwipe.c1
-rw-r--r--src/test/test_channeltls.c2
-rw-r--r--src/test/test_scheduler.c3
-rw-r--r--src/test/test_status.c2
-rw-r--r--src/trunnel/ed25519_cert.c6
-rw-r--r--src/trunnel/ed25519_cert.h2
-rw-r--r--src/trunnel/link_handshake.c12
-rw-r--r--src/trunnel/link_handshake.h2
-rw-r--r--src/trunnel/pwbox.c6
-rw-r--r--src/trunnel/pwbox.h2
21 files changed, 41 insertions, 30 deletions
diff --git a/src/common/address.c b/src/common/address.c
index 5cd7a8df67..6799dd6c56 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -1603,6 +1603,7 @@ get_interface_addresses_raw,(int severity, sa_family_t family))
return result;
#endif
(void) severity;
+ (void) result;
return NULL;
}
diff --git a/src/common/crypto.h b/src/common/crypto.h
index 8f1217e2bd..2d1155e205 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -13,6 +13,8 @@
#ifndef TOR_CRYPTO_H
#define TOR_CRYPTO_H
+#include "orconfig.h"
+
#include <stdio.h>
#include "torint.h"
#include "testsupport.h"
diff --git a/src/common/util.c b/src/common/util.c
index 211ed7f8d2..259ff8756f 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -4702,13 +4702,13 @@ tor_get_exit_code(process_handle_t *process_handle,
return PROCESS_EXIT_RUNNING;
} else if (retval != process_handle->pid) {
log_warn(LD_GENERAL, "waitpid() failed for PID %d: %s",
- process_handle->pid, strerror(errno));
+ (int)process_handle->pid, strerror(errno));
return PROCESS_EXIT_ERROR;
}
if (!WIFEXITED(stat_loc)) {
log_warn(LD_GENERAL, "Process %d did not exit normally",
- process_handle->pid);
+ (int)process_handle->pid);
return PROCESS_EXIT_ERROR;
}
diff --git a/src/ext/ed25519/donna/ed25519_tor.c b/src/ext/ed25519/donna/ed25519_tor.c
index 07f6a0f23a..9537ae66a1 100644
--- a/src/ext/ed25519/donna/ed25519_tor.c
+++ b/src/ext/ed25519/donna/ed25519_tor.c
@@ -34,7 +34,7 @@
#define ED25519_FN2(fn,suffix) ED25519_FN3(fn,suffix)
#define ED25519_FN(fn) ED25519_FN2(fn,ED25519_SUFFIX)
-
+#include "orconfig.h"
#include "ed25519-donna.h"
#include "ed25519_donna_tor.h"
#include "ed25519-randombytes.h"
diff --git a/src/ext/ed25519/ref10/keypair.c b/src/ext/ed25519/ref10/keypair.c
index 7ddbaa971e..68a88f9adc 100644
--- a/src/ext/ed25519/ref10/keypair.c
+++ b/src/ext/ed25519/ref10/keypair.c
@@ -1,6 +1,7 @@
/* Modified for Tor: new API, 64-byte secret keys. */
-#include <string.h>
+
#include "randombytes.h"
+#include <string.h>
#include "crypto_sign.h"
#include "crypto_hash_sha512.h"
#include "ge.h"
diff --git a/src/ext/ed25519/ref10/open.c b/src/ext/ed25519/ref10/open.c
index 9dbeb4cdd0..3ab7b7d6e7 100644
--- a/src/ext/ed25519/ref10/open.c
+++ b/src/ext/ed25519/ref10/open.c
@@ -1,6 +1,7 @@
/* (Modified by Tor to verify signature separately from message) */
-#include <string.h>
+
#include "crypto_sign.h"
+#include <string.h>
#include "crypto_hash_sha512.h"
#include "crypto_verify_32.h"
#include "ge.h"
diff --git a/src/ext/trunnel/trunnel-impl.h b/src/ext/trunnel/trunnel-impl.h
index dfe5f89e1a..3ffde6e09b 100644
--- a/src/ext/trunnel/trunnel-impl.h
+++ b/src/ext/trunnel/trunnel-impl.h
@@ -1,4 +1,4 @@
-/* trunnel-impl.h -- copied from Trunnel v1.4.4
+/* trunnel-impl.h -- copied from Trunnel v1.4.6
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
@@ -11,12 +11,12 @@
#ifndef TRUNNEL_IMPL_H_INCLUDED_
#define TRUNNEL_IMPL_H_INCLUDED_
-#include "trunnel.h"
-#include <assert.h>
-#include <string.h>
#ifdef TRUNNEL_LOCAL_H
#include "trunnel-local.h"
#endif
+#include "trunnel.h"
+#include <assert.h>
+#include <string.h>
#if defined(_MSC_VER) && (_MSC_VER < 1600)
#define uint8_t unsigned char
diff --git a/src/ext/trunnel/trunnel.c b/src/ext/trunnel/trunnel.c
index 0ed75aa9a4..3994422643 100644
--- a/src/ext/trunnel/trunnel.c
+++ b/src/ext/trunnel/trunnel.c
@@ -1,4 +1,4 @@
-/* trunnel.c -- copied from Trunnel v1.4.4
+/* trunnel.c -- copied from Trunnel v1.4.6
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
@@ -10,9 +10,9 @@
* See trunnel-impl.h for documentation of these functions.
*/
+#include "trunnel-impl.h"
#include <stdlib.h>
#include <string.h>
-#include "trunnel-impl.h"
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
diff --git a/src/ext/trunnel/trunnel.h b/src/ext/trunnel/trunnel.h
index 62e87ee50c..41068b8fb3 100644
--- a/src/ext/trunnel/trunnel.h
+++ b/src/ext/trunnel/trunnel.h
@@ -1,4 +1,4 @@
-/* trunnel.h -- copied from Trunnel v1.4.4
+/* trunnel.h -- copied from Trunnel v1.4.6
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
diff --git a/src/or/circuitmux_ewma.c b/src/or/circuitmux_ewma.c
index b784a140ac..13836cdcfa 100644
--- a/src/or/circuitmux_ewma.c
+++ b/src/or/circuitmux_ewma.c
@@ -8,6 +8,8 @@
#define TOR_CIRCUITMUX_EWMA_C_
+#include "orconfig.h"
+
#include <math.h>
#include "or.h"
diff --git a/src/test/test-child.c b/src/test/test-child.c
index e2552a499d..fdf3ccec0a 100644
--- a/src/test/test-child.c
+++ b/src/test/test-child.c
@@ -1,8 +1,8 @@
/* Copyright (c) 2011-2016, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include <stdio.h>
#include "orconfig.h"
+#include <stdio.h>
#ifdef _WIN32
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c
index 8187c45461..21882448c3 100644
--- a/src/test/test-memwipe.c
+++ b/src/test/test-memwipe.c
@@ -1,3 +1,4 @@
+#include "orconfig.h"
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/test/test_channeltls.c b/src/test/test_channeltls.c
index bde46a2998..08442e01b6 100644
--- a/src/test/test_channeltls.c
+++ b/src/test/test_channeltls.c
@@ -1,6 +1,8 @@
/* Copyright (c) 2014-2016, The Tor Project, Inc. */
/* See LICENSE for licensing information */
+#include "orconfig.h"
+
#include <math.h>
#define TOR_CHANNEL_INTERNAL_
diff --git a/src/test/test_scheduler.c b/src/test/test_scheduler.c
index 2e0736f99b..05ea8e86e8 100644
--- a/src/test/test_scheduler.c
+++ b/src/test/test_scheduler.c
@@ -1,10 +1,9 @@
/* Copyright (c) 2014-2016, The Tor Project, Inc. */
/* See LICENSE for licensing information */
-#include <math.h>
-
#include "orconfig.h"
+#include <math.h>
#include <event2/event.h>
#define TOR_CHANNEL_INTERNAL_
diff --git a/src/test/test_status.c b/src/test/test_status.c
index b4438aabe9..a3b1a2af87 100644
--- a/src/test/test_status.c
+++ b/src/test/test_status.c
@@ -3,6 +3,8 @@
#define LOG_PRIVATE
#define REPHIST_PRIVATE
+#include "orconfig.h"
+
#include <float.h>
#include <math.h>
diff --git a/src/trunnel/ed25519_cert.c b/src/trunnel/ed25519_cert.c
index f495743667..24988d510b 100644
--- a/src/trunnel/ed25519_cert.c
+++ b/src/trunnel/ed25519_cert.c
@@ -1,4 +1,4 @@
-/* ed25519_cert.c -- generated by Trunnel v1.4.4.
+/* ed25519_cert.c -- generated by Trunnel v1.4.6.
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
@@ -157,7 +157,7 @@ ed25519_cert_extension_setlen_un_unparsed(ed25519_cert_extension_t *inp, size_t
&inp->un_unparsed.n_, inp->un_unparsed.elts_, newlen,
sizeof(inp->un_unparsed.elts_[0]), (trunnel_free_fn_t) NULL,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->un_unparsed.elts_ = newptr;
return 0;
@@ -589,7 +589,7 @@ ed25519_cert_setlen_ext(ed25519_cert_t *inp, size_t newlen)
&inp->ext.n_, inp->ext.elts_, newlen,
sizeof(inp->ext.elts_[0]), (trunnel_free_fn_t) ed25519_cert_extension_free,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->ext.elts_ = newptr;
return 0;
diff --git a/src/trunnel/ed25519_cert.h b/src/trunnel/ed25519_cert.h
index 75a82d8aff..28f6feef31 100644
--- a/src/trunnel/ed25519_cert.h
+++ b/src/trunnel/ed25519_cert.h
@@ -1,4 +1,4 @@
-/* ed25519_cert.h -- generated by by Trunnel v1.4.4.
+/* ed25519_cert.h -- generated by by Trunnel v1.4.6.
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
diff --git a/src/trunnel/link_handshake.c b/src/trunnel/link_handshake.c
index 3ef7341ae9..c2717f36bf 100644
--- a/src/trunnel/link_handshake.c
+++ b/src/trunnel/link_handshake.c
@@ -1,4 +1,4 @@
-/* link_handshake.c -- generated by Trunnel v1.4.4.
+/* link_handshake.c -- generated by Trunnel v1.4.6.
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
@@ -143,7 +143,7 @@ auth_challenge_cell_setlen_methods(auth_challenge_cell_t *inp, size_t newlen)
&inp->methods.n_, inp->methods.elts_, newlen,
sizeof(inp->methods.elts_[0]), (trunnel_free_fn_t) NULL,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->methods.elts_ = newptr;
return 0;
@@ -452,7 +452,7 @@ certs_cell_cert_setlen_body(certs_cell_cert_t *inp, size_t newlen)
&inp->body.n_, inp->body.elts_, newlen,
sizeof(inp->body.elts_[0]), (trunnel_free_fn_t) NULL,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->body.elts_ = newptr;
return 0;
@@ -747,7 +747,7 @@ rsa_ed_crosscert_setlen_sig(rsa_ed_crosscert_t *inp, size_t newlen)
&inp->sig.n_, inp->sig.elts_, newlen,
sizeof(inp->sig.elts_[0]), (trunnel_free_fn_t) NULL,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->sig.elts_ = newptr;
return 0;
@@ -1268,7 +1268,7 @@ auth1_setlen_sig(auth1_t *inp, size_t newlen)
&inp->sig.n_, inp->sig.elts_, newlen,
sizeof(inp->sig.elts_[0]), (trunnel_free_fn_t) NULL,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->sig.elts_ = newptr;
return 0;
@@ -1714,7 +1714,7 @@ certs_cell_setlen_certs(certs_cell_t *inp, size_t newlen)
&inp->certs.n_, inp->certs.elts_, newlen,
sizeof(inp->certs.elts_[0]), (trunnel_free_fn_t) certs_cell_cert_free,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->certs.elts_ = newptr;
return 0;
diff --git a/src/trunnel/link_handshake.h b/src/trunnel/link_handshake.h
index 2749ec7dd4..54611b96e8 100644
--- a/src/trunnel/link_handshake.h
+++ b/src/trunnel/link_handshake.h
@@ -1,4 +1,4 @@
-/* link_handshake.h -- generated by by Trunnel v1.4.4.
+/* link_handshake.h -- generated by by Trunnel v1.4.6.
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
diff --git a/src/trunnel/pwbox.c b/src/trunnel/pwbox.c
index 9b348a9b30..62662a9369 100644
--- a/src/trunnel/pwbox.c
+++ b/src/trunnel/pwbox.c
@@ -1,4 +1,4 @@
-/* pwbox.c -- generated by Trunnel v1.4.4.
+/* pwbox.c -- generated by Trunnel v1.4.6.
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/
@@ -151,7 +151,7 @@ pwbox_encoded_setlen_skey_header(pwbox_encoded_t *inp, size_t newlen)
&inp->skey_header.n_, inp->skey_header.elts_, newlen,
sizeof(inp->skey_header.elts_[0]), (trunnel_free_fn_t) NULL,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->skey_header.elts_ = newptr;
return 0;
@@ -226,7 +226,7 @@ pwbox_encoded_setlen_data(pwbox_encoded_t *inp, size_t newlen)
&inp->data.n_, inp->data.elts_, newlen,
sizeof(inp->data.elts_[0]), (trunnel_free_fn_t) NULL,
&inp->trunnel_error_code_);
- if (newptr == NULL)
+ if (newlen != 0 && newptr == NULL)
goto trunnel_alloc_failed;
inp->data.elts_ = newptr;
return 0;
diff --git a/src/trunnel/pwbox.h b/src/trunnel/pwbox.h
index e69e2c1a0e..77a813d123 100644
--- a/src/trunnel/pwbox.h
+++ b/src/trunnel/pwbox.h
@@ -1,4 +1,4 @@
-/* pwbox.h -- generated by by Trunnel v1.4.4.
+/* pwbox.h -- generated by by Trunnel v1.4.6.
* https://gitweb.torproject.org/trunnel.git
* You probably shouldn't edit this file.
*/