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

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