diff -Nru netsed-1.2/debian/changelog netsed-1.2/debian/changelog --- netsed-1.2/debian/changelog 2016-04-30 23:14:09.000000000 +0000 +++ netsed-1.2/debian/changelog 2016-09-02 12:42:55.000000000 +0000 @@ -1,3 +1,11 @@ +netsed (1.2-3) unstable; urgency=medium + + * Address FTBFS due to test suite failure. + + debian/patches/use_calloc.diff: New file. (Closes: #818852, #831270) + + debian/patches/ruby_issues.diff: New file. + + -- Mats Erik Andersson Fri, 02 Sep 2016 14:42:55 +0200 + netsed (1.2-2) unstable; urgency=low * Step Standards-Version to 3.9.8, no changes. diff -Nru netsed-1.2/debian/patches/ruby_issues.diff netsed-1.2/debian/patches/ruby_issues.diff --- netsed-1.2/debian/patches/ruby_issues.diff 1970-01-01 00:00:00.000000000 +0000 +++ netsed-1.2/debian/patches/ruby_issues.diff 2016-09-02 12:42:55.000000000 +0000 @@ -0,0 +1,19 @@ +Description: Ruby interpreter complains. + During builds against glibc version 2.23, an error report mentioned + that implicit conversion of nil to an empty string is not automatic. +Author: Mats Erik Andersson +Forwarded: no +Last-Update: 2016-06-18 + +diff -Naurp netsed-1.2.orig/test/test_helper.rb netsed-1.2/test/test_helper.rb +--- netsed-1.2.orig/test/test_helper.rb 2013-10-13 17:08:07.000000000 +0200 ++++ netsed-1.2/test/test_helper.rb 2016-06-18 11:27:18.990947997 +0200 +@@ -47,7 +47,7 @@ class NetsedRun + # waiting for netsed to listen + begin + line = @pipe.gets +- @data << line ++ @data << line.to_s + end until line =~ /^\[\+\] Listening on port/ + end + diff -Nru netsed-1.2/debian/patches/series netsed-1.2/debian/patches/series --- netsed-1.2/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ netsed-1.2/debian/patches/series 2016-09-02 12:42:55.000000000 +0000 @@ -0,0 +1,2 @@ +use_calloc.diff +ruby_issues.diff diff -Nru netsed-1.2/debian/patches/use_calloc.diff netsed-1.2/debian/patches/use_calloc.diff --- netsed-1.2/debian/patches/use_calloc.diff 1970-01-01 00:00:00.000000000 +0000 +++ netsed-1.2/debian/patches/use_calloc.diff 2016-09-02 12:42:55.000000000 +0000 @@ -0,0 +1,26 @@ +Description: Build failure during test phase. + When built against glibc version 2.23, the provided tests + fail completely. The cause turns out to be a segmentation + fault in the rule interpreter. The upstream code implicitly + depends on a counter field being zeroed at return from malloc. + Instead use calloc() for the large structures. +Bug-Debian: http://bugs.debian.org/818852 + http://bugs.debian.org/831270 +Author: Mats Erik Andersson +Forwarded: yes +Last-Update: 2016-09-02 + +diff -Naup netsed-1.2.orig/netsed.c netsed-1.2/netsed.c +--- netsed-1.2.orig/netsed.c 2013-10-13 17:08:07.000000000 +0200 ++++ netsed-1.2/netsed.c 2016-09-02 14:13:10.477993876 +0200 +@@ -506,8 +506,8 @@ void parse_params(int argc,char* argv[]) + rport = argv[optind++]; + + // allocate rule arrays, rule number is number of params after 5 +- rule=malloc((argc-optind)*sizeof(struct rule_s)); +- rule_live=malloc((argc-optind)*sizeof(int)); ++ rule=calloc(argc-optind,sizeof(struct rule_s)); ++ rule_live=calloc(argc-optind,sizeof(int)); + // parse rules + for (i=optind;i