diff --git a/debian/changelog b/debian/changelog index 8cd8a1c..acabe2d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ohcount (3.1.0-2) unstable; urgency=medium + + * Fix a FTBFS (arm64 due to buffer overflow) + Thanks to Steve Langasek for the patch + (Closes: #895111) + + -- Sylvestre Ledru Sat, 07 Apr 2018 23:40:10 +0200 + ohcount (3.1.0-1) unstable; urgency=medium * New upstream release diff --git a/debian/patches/fix-buffer-overflow.patch b/debian/patches/fix-buffer-overflow.patch new file mode 100644 index 0000000..b7913d5 --- /dev/null +++ b/debian/patches/fix-buffer-overflow.patch @@ -0,0 +1,18 @@ +Description: fix a buffer overflow due to an off-by one + This manifests as a build failure on arm64 in Ubuntu. +Author: Steve Langasek +Last-Modified: 2018-04-07 + +Index: ohcount-3.1.0/src/diff.c +=================================================================== +--- ohcount-3.1.0.orig/src/diff.c ++++ ohcount-3.1.0/src/diff.c +@@ -315,7 +315,7 @@ static int hash(char *line) { + void prepare(int i, const char *buf) { + struct line *p; + int j; +- char bufcpy[strlen(buf)]; ++ char bufcpy[strlen(buf)+1]; + char *l; + + p = malloc(3*sizeof(struct line)); diff --git a/debian/patches/series b/debian/patches/series index e3bc2a1..470fc83 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ disabled_test_suite.patch conflicting-type.diff build-cflags.diff +fix-buffer-overflow.patch