diff options
-rw-r--r-- | changes/bug27463 | 3 | ||||
-rw-r--r-- | changes/bug27465 | 5 | ||||
-rw-r--r-- | src/common/address.c | 5 | ||||
-rw-r--r-- | src/or/rendclient.c | 9 |
4 files changed, 21 insertions, 1 deletions
diff --git a/changes/bug27463 b/changes/bug27463 new file mode 100644 index 0000000000..073acdd997 --- /dev/null +++ b/changes/bug27463 @@ -0,0 +1,3 @@ + o Minor bugfixes (onion services): + - Silence a spurious compiler warning in rend_client_send_introduction(). + Fixes bug 27463; bugfix on 0.1.1.2-alpha. diff --git a/changes/bug27465 b/changes/bug27465 new file mode 100644 index 0000000000..743b35130f --- /dev/null +++ b/changes/bug27465 @@ -0,0 +1,5 @@ + o Minor bugfixes (compilation): + - Silence a spurious compiler warning on the GetAdaptersAddresses + function pointer cast. This issue is already fixed by 26481 in + 0.3.5 and later, by removing the lookup and cast. + Fixes bug 27465; bugfix on 0.2.3.11-alpha. diff --git a/src/common/address.c b/src/common/address.c index 96b99fa082..794345a138 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -1492,7 +1492,10 @@ get_interface_addresses_win32(int severity, sa_family_t family) goto done; } - if (!(fn = (GetAdaptersAddresses_fn_t) + /* Cast through a void function pointer, to silence a spurious compiler + * warning on 64-bit Windows. This cast is safe, because we are casting to + * the correct type for GetAdaptersAddresses(). */ + if (!(fn = (GetAdaptersAddresses_fn_t)(void(*)(void)) GetProcAddress(lib, "GetAdaptersAddresses"))) { log_fn(severity, LD_NET, "Unable to obtain pointer to " "GetAdaptersAddresses"); diff --git a/src/or/rendclient.c b/src/or/rendclient.c index a93bc94a9c..f0144b076f 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -269,6 +269,15 @@ rend_client_send_introduction(origin_circuit_t *introcirc, dh_offset = v3_shift+7+DIGEST_LEN+2+klen+REND_COOKIE_LEN; } else { /* Version 0. */ + + /* Some compilers are smart enough to work out that nickname can be more + * than 19 characters, when it's a hexdigest. They warn that strncpy() + * will truncate hexdigests without NUL-terminating them. But we only put + * hexdigests in HSDir and general circuit exits. */ + if (BUG(strlen(rendcirc->build_state->chosen_exit->nickname) + > MAX_NICKNAME_LEN)) { + goto perm_err; + } strncpy(tmp, rendcirc->build_state->chosen_exit->nickname, (MAX_NICKNAME_LEN+1)); /* nul pads */ memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie, |