aboutsummaryrefslogtreecommitdiffstats
path: root/community/djvulibre/djvulibre-3.5.27-out-of-bound-write-2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/djvulibre/djvulibre-3.5.27-out-of-bound-write-2.patch')
-rw-r--r--community/djvulibre/djvulibre-3.5.27-out-of-bound-write-2.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/community/djvulibre/djvulibre-3.5.27-out-of-bound-write-2.patch b/community/djvulibre/djvulibre-3.5.27-out-of-bound-write-2.patch
new file mode 100644
index 00000000000..f2fae470e66
--- /dev/null
+++ b/community/djvulibre/djvulibre-3.5.27-out-of-bound-write-2.patch
@@ -0,0 +1,14 @@
+diff --git a/libdjvu/DjVuText.cpp b/libdjvu/DjVuText.cpp
+index 60a4f39..b11df7b 100644
+--- a/libdjvu/DjVuText.cpp
++++ b/libdjvu/DjVuText.cpp
+@@ -345,7 +345,8 @@ DjVuTXT::decode(const GP<ByteStream> &gbs)
+ int textsize = bs.read24();
+ char *buffer = textUTF8.getbuf(textsize);
+ int readsize = bs.read(buffer,textsize);
+- buffer[readsize] = 0;
++ if (buffer)
++ buffer[readsize] = 0;
+ if (readsize < textsize)
+ G_THROW( ERR_MSG("DjVuText.corrupt_chunk") );
+ // Try reading zones