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

a9380a
diff --git a/libdjvu/DjVuText.cpp b/libdjvu/DjVuText.cpp
a9380a
index 60a4f39..b11df7b 100644
a9380a
--- a/libdjvu/DjVuText.cpp
a9380a
+++ b/libdjvu/DjVuText.cpp
a9380a
@@ -345,7 +345,8 @@ DjVuTXT::decode(const GP<ByteStream> &gbs)
a9380a
   int textsize = bs.read24();
a9380a
   char *buffer = textUTF8.getbuf(textsize);
a9380a
   int readsize = bs.read(buffer,textsize);
a9380a
-  buffer[readsize] = 0;
a9380a
+  if (buffer)
a9380a
+    buffer[readsize] = 0;
a9380a
   if (readsize < textsize)
a9380a
     G_THROW( ERR_MSG("DjVuText.corrupt_chunk") );
a9380a
   // Try reading zones