diff options
-rw-r--r-- | main/eboard/APKBUILD | 6 | ||||
-rw-r--r-- | main/eboard/eboard-const-safety.patch | 37 |
2 files changed, 41 insertions, 2 deletions
diff --git a/main/eboard/APKBUILD b/main/eboard/APKBUILD index 2fc11ca7a5..a30231dbbd 100644 --- a/main/eboard/APKBUILD +++ b/main/eboard/APKBUILD @@ -13,7 +13,8 @@ install="" subpackages="$pkgname-dev $pkgname-doc" source="http://prdownloads.sourceforge.net/eboard/eboard-$pkgver.tar.bz2 eboard-libpng-1.5.patch - eboard.desktop" + eboard.desktop + eboard-const-safety.patch" _builddir="$srcdir"/eboard-$pkgver prepare() { @@ -44,4 +45,5 @@ package() { md5sums="03dcdaa2bc85218b1b18c4bee276fea7 eboard-1.1.1.tar.bz2 349dd8db4cca191925b9d30fb0da837b eboard-libpng-1.5.patch -70f985b6841c2e6374555a5a4c0cca79 eboard.desktop" +70f985b6841c2e6374555a5a4c0cca79 eboard.desktop +9d2c97f724a083de7f39a4b3e87f22fe eboard-const-safety.patch" diff --git a/main/eboard/eboard-const-safety.patch b/main/eboard/eboard-const-safety.patch new file mode 100644 index 0000000000..de275c3bb6 --- /dev/null +++ b/main/eboard/eboard-const-safety.patch @@ -0,0 +1,37 @@ +--- eboard-1.1.1.orig/ntext.cc ++++ eboard-1.1.1/ntext.cc +@@ -237,6 +237,7 @@ + void NText::append(const char *text, int len, int color) { + int i; + NLine *nl; ++ char buf[len + 1]; + char *p; + + if (len < 0) { +@@ -244,11 +245,14 @@ + return; + } + +- p = strchr(text, '\n'); ++ strncpy(buf, text, len); ++ buf[len] = '\0'; ++ ++ p = strchr(buf, '\n'); + if (p!=NULL) { + *p = 0; +- i = strlen(text); +- nl = new NLine(text, color); ++ i = strlen(buf); ++ nl = new NLine(buf, color); + *p = '\n'; + lines.push_back(nl); + formatLine(lines.size()-1); +@@ -257,7 +261,7 @@ + } + + // if search for \n failed, this is a single line +- nl = new NLine(text, color); ++ nl = new NLine(buf, color); + lines.push_back(nl); + formatLine(lines.size()-1); + discardExcess(); |