diff -Nru swath-0.4.0/debian/changelog swath-0.4.0/debian/changelog --- swath-0.4.0/debian/changelog 2010-01-14 15:24:18.000000000 +0700 +++ swath-0.4.0/debian/changelog 2013-01-21 16:26:19.000000000 +0700 @@ -1,3 +1,11 @@ +swath (0.4.0-4+squeeze1) stable; urgency=high + + * debian/patches/01_buffer-overflow.patch: backport patch from upstream + to fix potential buffer overflow in Mule mode. + Thanks Dominik Maier for the report. (Closes: #698189) + + -- Theppitak Karoonboonyanan Mon, 21 Jan 2013 15:03:30 +0700 + swath (0.4.0-4) unstable; urgency=low * debian/rules: Fix failure to build twice in a row: diff -Nru swath-0.4.0/debian/patches/01_buffer-overflow.patch swath-0.4.0/debian/patches/01_buffer-overflow.patch --- swath-0.4.0/debian/patches/01_buffer-overflow.patch 1970-01-01 07:00:00.000000000 +0700 +++ swath-0.4.0/debian/patches/01_buffer-overflow.patch 2013-01-21 16:26:19.000000000 +0700 @@ -0,0 +1,22 @@ +Author: Theppitak Karoonboonyanan +Description: Fix potential buffer overflow +Origin: backport, http://linux.thai.net/websvn/wsvn/software.swath/trunk?op=revision&rev=238&peg=238 +Bug-Debian: http://bugs.debian.org/698189 + +Index: swath/src/wordseg.cpp +=================================================================== +--- swath.orig/src/wordseg.cpp 2013-01-21 13:19:24.261886743 +0700 ++++ swath/src/wordseg.cpp 2013-01-21 13:20:31.693890376 +0700 +@@ -253,11 +253,7 @@ + } + delete FltX; + }else{ +- char stopstr[20]; +- if (muleMode) +- strcpy(stopstr,wbr); +- else +- stopstr[0]='\0'; ++ const char *stopstr = muleMode ? wbr : ""; + for (;;) { // read until end of file. + if (mode == 0) printf("Input : "); + for (i = 0; ((c = fgetc(tmpin)) != '\n') diff -Nru swath-0.4.0/debian/patches/series swath-0.4.0/debian/patches/series --- swath-0.4.0/debian/patches/series 1970-01-01 07:00:00.000000000 +0700 +++ swath-0.4.0/debian/patches/series 2013-01-21 16:26:19.000000000 +0700 @@ -0,0 +1 @@ +01_buffer-overflow.patch