mirror of
https://github.com/qpdf/qpdf.git
synced 2025-03-03 17:15:46 +00:00
Handle jpeg library fuzz false positives
The jpeg library has some assembly code that is missed by the compiler instrumentation used by memory sanitization. There is a runtime environment variable that is used to work around this issue.
This commit is contained in:
parent
c1684eae91
commit
232f5fc9f3
@ -2,6 +2,7 @@
|
||||
#include <qpdf/Pl_DCT.hh>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <cstdlib>
|
||||
|
||||
class FuzzHelper
|
||||
{
|
||||
@ -46,6 +47,11 @@ FuzzHelper::run()
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(unsigned char const* data, size_t size)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
// Used by jpeg library to work around false positives in memory
|
||||
// sanitizer.
|
||||
setenv("JSIMD_FORCENONE", "1", 1);
|
||||
#endif
|
||||
FuzzHelper f(data, size);
|
||||
f.run();
|
||||
return 0;
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <qpdf/QPDFPageLabelDocumentHelper.hh>
|
||||
#include <qpdf/QPDFOutlineDocumentHelper.hh>
|
||||
#include <qpdf/QPDFAcroFormDocumentHelper.hh>
|
||||
#include <cstdlib>
|
||||
|
||||
class DiscardContents: public QPDFObjectHandle::ParserCallbacks
|
||||
{
|
||||
@ -223,6 +224,11 @@ FuzzHelper::run()
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(unsigned char const* data, size_t size)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
// Used by jpeg library to work around false positives in memory
|
||||
// sanitizer.
|
||||
setenv("JSIMD_FORCENONE", "1", 1);
|
||||
#endif
|
||||
FuzzHelper f(data, size);
|
||||
f.run();
|
||||
return 0;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stdexcept>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
#if BITS_IN_JSAMPLE != 8
|
||||
# error "qpdf does not support libjpeg built with BITS_IN_JSAMPLE != 8"
|
||||
|
Loading…
x
Reference in New Issue
Block a user