[DRE-commits] [SCM] thin.git branch, master, updated. debian/1.3.1-1-4-g302e0e8

Ryan Niebur ryanryan52 at gmail.com
Sat Jun 16 09:04:24 UTC 2012


The following commit has been merged in the master branch:
commit 730e1cda7c4d7b980afce54546921ea999d8ff1b
Author: Ryan Niebur <ryanryan52 at gmail.com>
Date:   Sat Jun 16 02:01:26 2012 -0700

    Add patch to pass format string as %s to allow for compiling with hardnening options (Closes: #676211)

diff --git a/debian/changelog b/debian/changelog
index 3057a9b..a7d91e2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+thin (1.3.1-2) UNRELEASED; urgency=low
+
+  * Add patch to pass format string as %s to allow for compiling with
+    hardnening options (Closes: #676211)
+
+ -- Ryan Niebur <ryan at debian.org>  Sat, 16 Jun 2012 02:00:23 -0700
+
 thin (1.3.1-1.1) unstable; urgency=high
 
   * Non-maintainer upload.
diff --git a/debian/patches/fix_hardening_FTBFS.patch b/debian/patches/fix_hardening_FTBFS.patch
new file mode 100644
index 0000000..d21b67d
--- /dev/null
+++ b/debian/patches/fix_hardening_FTBFS.patch
@@ -0,0 +1,18 @@
+Description: Use %s as a formatting string in VALIDATE_MAX_LENGTH to
+ compile with -Werror=format-security for hardening purposes
+Bug-Debian: http://bugs.debian.org/676211
+Author: Ryan Niebur <ryan at debian.org>
+
+Index: thin/ext/thin_parser/thin.c
+===================================================================
+--- thin.orig/ext/thin_parser/thin.c	2012-02-07 12:51:55.000000000 -0800
++++ thin/ext/thin_parser/thin.c	2012-06-16 01:53:36.000000000 -0700
+@@ -47,7 +47,7 @@
+ #define DEF_MAX_LENGTH(N,length) const size_t MAX_##N##_LENGTH = length; const char *MAX_##N##_LENGTH_ERR = "HTTP element " # N  " is longer than the " # length " allowed length."
+ 
+ /** Validates the max length of given input and throws an HttpParserError exception if over. */
+-#define VALIDATE_MAX_LENGTH(len, N) if(len > MAX_##N##_LENGTH) { rb_raise(eHttpParserError, MAX_##N##_LENGTH_ERR); }
++#define VALIDATE_MAX_LENGTH(len, N) if(len > MAX_##N##_LENGTH) { rb_raise(eHttpParserError, "%s", MAX_##N##_LENGTH_ERR); }
+ 
+ /** Defines global strings in the init method. */
+ #define DEF_GLOBAL(N, val)   global_##N = rb_obj_freeze(rb_str_new2(val)); rb_global_variable(&global_##N)
diff --git a/debian/patches/series b/debian/patches/series
index eb9fd39..5b587ff 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 fix-init-script
 dont-allow-install
 fix_require_path_for_thin_parser.patch
+fix_hardening_FTBFS.patch

-- 
thin.git



More information about the Pkg-ruby-extras-commits mailing list