Blame SOURCES/djvulibre-3.5.27-out-of-bound-write.patch

a9380a
From 7b0ef20690e08f1fe124aebbf42f6310e2f40f81 Mon Sep 17 00:00:00 2001
a9380a
From: Leon Bottou <leon@bottou.org>
a9380a
Date: Thu, 27 Jun 2019 18:38:03 -0400
a9380a
Subject: [PATCH] Lizards!
a9380a
a9380a
---
a9380a
 libdjvu/GString.cpp | 6 +++---
a9380a
 1 file changed, 3 insertions(+), 3 deletions(-)
a9380a
a9380a
diff --git a/libdjvu/GString.cpp b/libdjvu/GString.cpp
a9380a
index bf98bfe..b17ed2a 100644
a9380a
--- a/libdjvu/GString.cpp
a9380a
+++ b/libdjvu/GString.cpp
a9380a
@@ -1216,11 +1216,11 @@ GP<GStringRep>
a9380a
 GStringRep::getbuf(int n) const
a9380a
 {
a9380a
   GP<GStringRep> retval;
a9380a
-  if(n< 0)
a9380a
+  if(n < 0)
a9380a
     n=strlen(data);
a9380a
-  if(n>0)
a9380a
+  if(n >= 0)
a9380a
   {
a9380a
-    retval=blank(n);
a9380a
+    retval=blank((n>0) ? n : 1);
a9380a
     char *ndata=retval->data;
a9380a
     strncpy(ndata,data,n);
a9380a
     ndata[n]=0;
a9380a
-- 
a9380a
2.31.1
a9380a