djvulibre/djvulibre-CVE-2021-3500.patch
Petr Gajdos 4fc139368f - security update
- added patches
  fix CVE-2021-3500 [bsc#1186253], Stack overflow in function DJVU:DjVuDocument:get_djvu_file() via crafted djvu file
  + djvulibre-CVE-2021-3500.patch

OBS-URL: https://build.opensuse.org/package/show/graphics/djvulibre?expand=0&rev=41
2021-05-24 08:56:15 +00:00

34 lines
849 B
Diff

--- a/libdjvu/DjVuPort.cpp
+++ a/libdjvu/DjVuPort.cpp
@@ -507,10 +507,19 @@ GP<DjVuFile>
DjVuPortcaster::id_to_file(const DjVuPort * source, const GUTF8String &id)
{
GPList<DjVuPort> list;
+
+ if (!!opening_id && opening_id == id)
+ G_THROW( ERR_MSG("DjVuPortcaster.recursive_open") );
+ else
+ opening_id = id;
+
compute_closure(source, list, true);
GP<DjVuFile> file;
for(GPosition pos=list;pos;++pos)
if ((file=list[pos]->id_to_file(source, id))) break;
+
+ opening_id = GUTF8String();
+
return file;
}
--- a/libdjvu/DjVuPort.h
+++ a/libdjvu/DjVuPort.h
@@ -484,6 +484,7 @@ private:
const DjVuPort *dst, int distance);
void compute_closure(const DjVuPort *src, GPList<DjVuPort> &list,
bool sorted=false);
+ GUTF8String opening_id;
};