]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Provide large enough buffer in test_util_sscanf()
authorSebastian Hahn <sebastian@torproject.org>
Tue, 27 Mar 2012 12:04:15 +0000 (14:04 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Tue, 27 Mar 2012 13:16:22 +0000 (15:16 +0200)
This was causing crashes during unit test runs, as stack smashing
protections got triggered. Issue spotted by weasel

changes/bug5449 [new file with mode: 0644]
src/test/test_util.c

diff --git a/changes/bug5449 b/changes/bug5449
new file mode 100644 (file)
index 0000000..48babb3
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes:
+    - In the testsuite, provide a large enough buffer in the tor_sscanf
+      unit test. We'd otherwise overrun that buffer and crash during the
+      unit tests. Fixes bug 5449; bugfix on 0.2.3.12-alpha. Thanks weasel
+      for spotting the bug.
+
index 0187187c0a8e94f3704da9c87bc1525f5175742e..9da4cb799434ca84a35b65f4a24e811a51a41ffe 100644 (file)
@@ -1376,7 +1376,7 @@ static void
 test_util_sscanf(void)
 {
   unsigned u1, u2, u3;
-  char s1[10], s2[10], s3[10], ch;
+  char s1[20], s2[10], s3[10], ch;
   int r;
 
   /* Simple tests (malformed patterns, literal matching, ...) */