summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-03-12 12:52:10 -0400
committerNick Mathewson <nickm@torproject.org>2015-03-12 12:52:10 -0400
commite573a519168d3746d429d27702e6e8a46e56411a (patch)
tree5e21149b69fd85b7ee52e0e995a001c5145917e0
parent6bf06c5656ddd2c3649db790b3bdbb14eb50aaee (diff)
parent9063f29160615b379f907009e7158f1fcf1ed84c (diff)
downloadtor-e573a519168d3746d429d27702e6e8a46e56411a.tar.gz
tor-e573a519168d3746d429d27702e6e8a46e56411a.zip
Merge branch 'maint-0.2.5' into release-0.2.5
-rw-r--r--changes/bug152055
-rw-r--r--src/common/compat.h12
2 files changed, 17 insertions, 0 deletions
diff --git a/changes/bug15205 b/changes/bug15205
new file mode 100644
index 0000000000..0cb9f3f4bc
--- /dev/null
+++ b/changes/bug15205
@@ -0,0 +1,5 @@
+ o Major bugfixes (crash, OSX, security):
+ - Fix a remote denial-of-service opportunity caused by a bug
+ in OSX's _strlcat_chk() function. Fixes bug 15205; bug first
+ appeared in OSX 10.9.
+
diff --git a/src/common/compat.h b/src/common/compat.h
index ec7d2415ed..531e88f1bd 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -224,6 +224,18 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif
+
+#if defined __APPLE__
+/* On OSX 10.9 and later, the overlap-checking code for strlcat would
+ * appear to have a severe bug that can sometimes cause aborts in Tor.
+ * Instead, use the non-checking variants. This is sad.
+ *
+ * See https://trac.torproject.org/projects/tor/ticket/15205
+ */
+#undef strlcat
+#undef strlcpy
+#endif
+
#ifndef HAVE_STRLCAT
size_t strlcat(char *dst, const char *src, size_t siz) ATTR_NONNULL((1,2));
#endif