summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-19 07:58:43 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-19 07:58:43 -0500
commitde656474611c43f24dd5fff430de945b34b738bf (patch)
treee0d5e0e39839d1892afdeb55b8d7cb6f1d9b4bc7 /src
parent169a93fff2510cf0eae76cdd198c19687bb1e875 (diff)
parentc11de4c45f5611a12fba005032941a40f5ce5f66 (diff)
downloadtor-de656474611c43f24dd5fff430de945b34b738bf.tar.gz
tor-de656474611c43f24dd5fff430de945b34b738bf.zip
Merge branch 'maint-0.2.8' into maint-0.2.9
Diffstat (limited to 'src')
-rw-r--r--src/or/rendcache.c4
-rw-r--r--src/or/routerparse.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/or/rendcache.c b/src/or/rendcache.c
index e61a96b677..aa69d735fe 100644
--- a/src/or/rendcache.c
+++ b/src/or/rendcache.c
@@ -915,7 +915,9 @@ rend_cache_store_v2_desc_as_client(const char *desc,
if (n_intro_points <= 0) {
log_warn(LD_REND, "Failed to parse introduction points. Either the "
"service has published a corrupt descriptor or you have "
- "provided invalid authorization data.");
+ "provided invalid authorization data, or (maybe!) the "
+ "server is deliberately serving broken data in an attempt "
+ "to crash you with bug 21018.");
goto err;
} else if (n_intro_points > MAX_INTRO_POINTS) {
log_warn(LD_REND, "Found too many introduction points on a hidden "
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index a78d1ee53e..d7e42529cd 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -4946,7 +4946,7 @@ get_next_token(memarea_t *area,
if (tok->tp == ERR_) {
/* No keyword matched; call it an "K_opt" or "A_unrecognized" */
- if (**s == '@')
+ if (*s < eol && **s == '@')
tok->tp = A_UNKNOWN_;
else
tok->tp = K_OPT;
@@ -5995,7 +5995,7 @@ rend_decrypt_introduction_points(char **ipos_decrypted,
crypto_cipher_free(cipher);
len = ipos_encrypted_size - 2 - client_entries_len - CIPHER_IV_LEN;
- dec = tor_malloc(len);
+ dec = tor_malloc_zero(len + 1);
declen = crypto_cipher_decrypt_with_iv(session_key, dec, len,
ipos_encrypted + 2 + client_entries_len,
ipos_encrypted_size - 2 - client_entries_len);
@@ -6027,7 +6027,7 @@ rend_decrypt_introduction_points(char **ipos_decrypted,
"small.");
return -1;
}
- dec = tor_malloc_zero(ipos_encrypted_size - CIPHER_IV_LEN - 1);
+ dec = tor_malloc_zero(ipos_encrypted_size - CIPHER_IV_LEN - 1 + 1);
declen = crypto_cipher_decrypt_with_iv(descriptor_cookie, dec,
ipos_encrypted_size -