Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
poppler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ceyhun Alp
poppler
Commits
979e51f7
Commit
979e51f7
authored
Oct 23, 2020
by
Ceyhun Alp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing clang_format issues
parent
80ec81ec
Pipeline
#217460
failed with stage
in 8 minutes and 7 seconds
Changes
19
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
718 additions
and
666 deletions
+718
-666
cpp/tests/fuzzing/FuzzedDataProvider.h
cpp/tests/fuzzing/FuzzedDataProvider.h
+280
-258
cpp/tests/fuzzing/doc_fuzzer.cc
cpp/tests/fuzzing/doc_fuzzer.cc
+6
-6
cpp/tests/fuzzing/fuzzer_temp_file.h
cpp/tests/fuzzing/fuzzer_temp_file.h
+41
-40
cpp/tests/fuzzing/page_label_fuzzer.cc
cpp/tests/fuzzing/page_label_fuzzer.cc
+1
-1
cpp/tests/fuzzing/page_search_fuzzer.cc
cpp/tests/fuzzing/page_search_fuzzer.cc
+1
-1
glib/tests/fuzzing/annot_fuzzer.c
glib/tests/fuzzing/annot_fuzzer.c
+2
-1
glib/tests/fuzzing/doc_attr_fuzzer.c
glib/tests/fuzzing/doc_attr_fuzzer.c
+2
-1
glib/tests/fuzzing/find_text_fuzzer.c
glib/tests/fuzzing/find_text_fuzzer.c
+2
-1
glib/tests/fuzzing/fuzzer_temp_file.h
glib/tests/fuzzing/fuzzer_temp_file.h
+41
-40
glib/tests/fuzzing/label_fuzzer.c
glib/tests/fuzzing/label_fuzzer.c
+2
-1
glib/tests/fuzzing/pdf_draw_fuzzer.c
glib/tests/fuzzing/pdf_draw_fuzzer.c
+2
-2
glib/tests/fuzzing/util_fuzzer.c
glib/tests/fuzzing/util_fuzzer.c
+2
-1
qt5/tests/fuzzing/FuzzedDataProvider.h
qt5/tests/fuzzing/FuzzedDataProvider.h
+280
-258
qt5/tests/fuzzing/fuzzer_temp_file.h
qt5/tests/fuzzing/fuzzer_temp_file.h
+41
-40
qt5/tests/fuzzing/qt_annot_fuzzer.cc
qt5/tests/fuzzing/qt_annot_fuzzer.cc
+3
-3
qt5/tests/fuzzing/qt_label_fuzzer.cc
qt5/tests/fuzzing/qt_label_fuzzer.cc
+3
-3
qt5/tests/fuzzing/qt_pdf_fuzzer.cc
qt5/tests/fuzzing/qt_pdf_fuzzer.cc
+3
-3
qt5/tests/fuzzing/qt_search_fuzzer.cc
qt5/tests/fuzzing/qt_search_fuzzer.cc
+3
-3
qt5/tests/fuzzing/qt_textbox_fuzzer.cc
qt5/tests/fuzzing/qt_textbox_fuzzer.cc
+3
-3
No files found.
cpp/tests/fuzzing/FuzzedDataProvider.h
View file @
979e51f7
This diff is collapsed.
Click to expand it.
cpp/tests/fuzzing/doc_fuzzer.cc
View file @
979e51f7
...
...
@@ -34,12 +34,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
doc
->
set_subject
(
poppler
::
ustring
::
from_latin1
(
in_sub
));
doc
->
set_title
(
poppler
::
ustring
::
from_latin1
(
in_title
));
doc
->
set_author
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_creator
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_keywords
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_producer
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_subject
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_title
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_author
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_creator
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_keywords
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_producer
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_subject
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
doc
->
set_title
(
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
));
delete
doc
;
return
0
;
...
...
cpp/tests/fuzzing/fuzzer_temp_file.h
View file @
979e51f7
...
...
@@ -26,56 +26,57 @@
// Pure-C interface for creating and cleaning up temporary files.
static
char
*
fuzzer_get_tmpfile
(
const
uint8_t
*
data
,
size_t
size
)
{
char
*
filename_buffer
=
strdup
(
"/tmp/generate_temporary_file.XXXXXX"
);
if
(
!
filename_buffer
)
{
perror
(
"Failed to allocate file name buffer."
);
abort
(
);
}
const
int
file_descriptor
=
mkstemp
(
filename_buffer
);
if
(
file_descriptor
<
0
)
{
perror
(
"Failed to make temporary file."
);
abort
(
);
}
FILE
*
file
=
fdopen
(
file_descriptor
,
"wb"
);
if
(
!
file
)
{
perror
(
"Failed to open file descriptor."
);
close
(
file_descriptor
);
abort
(
);
}
const
size_t
bytes_written
=
fwrite
(
data
,
sizeof
(
uint8_t
),
size
,
file
);
if
(
bytes_written
<
size
)
{
close
(
file_descriptor
);
fprintf
(
stderr
,
"Failed to write all bytes to file (%zu out of %zu)"
,
bytes_written
,
size
);
abort
();
}
fclose
(
file
);
return
filename_buffer
;
static
char
*
fuzzer_get_tmpfile
(
const
uint8_t
*
data
,
size_t
size
)
{
char
*
filename_buffer
=
strdup
(
"/tmp/generate_temporary_file.XXXXXX"
);
if
(
!
filename_buffer
)
{
perror
(
"Failed to allocate file name buffer."
);
abort
();
}
const
int
file_descriptor
=
mkstemp
(
filename_buffer
);
if
(
file_descriptor
<
0
)
{
perror
(
"Failed to make temporary file."
);
abort
();
}
FILE
*
file
=
fdopen
(
file_descriptor
,
"wb"
);
if
(
!
file
)
{
perror
(
"Failed to open file descriptor."
);
close
(
file_descriptor
);
abort
();
}
const
size_t
bytes_written
=
fwrite
(
data
,
sizeof
(
uint8_t
),
size
,
file
);
if
(
bytes_written
<
size
)
{
close
(
file_descriptor
);
fprintf
(
stderr
,
"Failed to write all bytes to file (%zu out of %zu)"
,
bytes_written
,
size
);
abort
();
}
fclose
(
file
);
return
filename_buffer
;
}
static
void
fuzzer_release_tmpfile
(
char
*
filename
)
{
if
(
unlink
(
filename
)
!=
0
)
{
perror
(
"WARNING: Failed to delete temporary file."
);
}
free
(
filename
);
static
void
fuzzer_release_tmpfile
(
char
*
filename
)
{
if
(
unlink
(
filename
)
!=
0
)
{
perror
(
"WARNING: Failed to delete temporary file."
);
}
free
(
filename
);
}
// C++ RAII object for creating temporary files.
#ifdef __cplusplus
class
FuzzerTemporaryFile
{
public:
FuzzerTemporaryFile
(
const
uint8_t
*
data
,
size_t
size
)
:
filename_
(
fuzzer_get_tmpfile
(
data
,
size
))
{
}
class
FuzzerTemporaryFile
{
public:
FuzzerTemporaryFile
(
const
uint8_t
*
data
,
size_t
size
)
:
filename_
(
fuzzer_get_tmpfile
(
data
,
size
))
{
}
~
FuzzerTemporaryFile
()
{
fuzzer_release_tmpfile
(
filename_
);
}
~
FuzzerTemporaryFile
()
{
fuzzer_release_tmpfile
(
filename_
);
}
const
char
*
filename
()
const
{
return
filename_
;
}
const
char
*
filename
()
const
{
return
filename_
;
}
private:
char
*
filename_
;
private:
char
*
filename_
;
};
#endif
#endif
// FUZZER_TEMP_FILE_H_
#endif // FUZZER_TEMP_FILE_H_
cpp/tests/fuzzing/page_label_fuzzer.cc
View file @
979e51f7
...
...
@@ -19,7 +19,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
poppler
::
page_renderer
r
;
for
(
int
i
=
0
;
i
<
doc
->
pages
();
i
++
)
{
poppler
::
ustring
label
=
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
);
poppler
::
ustring
label
=
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
);
poppler
::
page
*
p
=
doc
->
create_page
(
label
);
if
(
!
p
)
{
continue
;
...
...
cpp/tests/fuzzing/page_search_fuzzer.cc
View file @
979e51f7
...
...
@@ -24,7 +24,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
continue
;
}
poppler
::
rectf
rect
=
p
->
page_rect
();
poppler
::
ustring
text
=
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
);
poppler
::
ustring
text
=
poppler
::
ustring
::
from_utf8
((
const
char
*
)
data
,
size
);
p
->
search
(
text
,
rect
,
poppler
::
page
::
search_from_top
,
poppler
::
case_insensitive
,
poppler
::
rotate_0
);
r
.
render_page
(
p
);
delete
p
;
...
...
glib/tests/fuzzing/annot_fuzzer.c
View file @
979e51f7
...
...
@@ -5,7 +5,8 @@
#include "fuzzer_temp_file.h"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
GError
*
err
=
NULL
;
PopplerDocument
*
doc
;
PopplerPage
*
page
;
...
...
glib/tests/fuzzing/doc_attr_fuzzer.c
View file @
979e51f7
#include <stdint.h>
#include <poppler.h>
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
GError
*
err
=
NULL
;
PopplerDocument
*
doc
;
PopplerPage
*
page
;
...
...
glib/tests/fuzzing/find_text_fuzzer.c
View file @
979e51f7
#include <stdint.h>
#include <poppler.h>
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
GError
*
err
=
NULL
;
PopplerDocument
*
doc
;
PopplerPage
*
page
;
...
...
glib/tests/fuzzing/fuzzer_temp_file.h
View file @
979e51f7
...
...
@@ -26,56 +26,57 @@
// Pure-C interface for creating and cleaning up temporary files.
static
char
*
fuzzer_get_tmpfile
(
const
uint8_t
*
data
,
size_t
size
)
{
char
*
filename_buffer
=
strdup
(
"/tmp/generate_temporary_file.XXXXXX"
);
if
(
!
filename_buffer
)
{
perror
(
"Failed to allocate file name buffer."
);
abort
(
);
}
const
int
file_descriptor
=
mkstemp
(
filename_buffer
);
if
(
file_descriptor
<
0
)
{
perror
(
"Failed to make temporary file."
);
abort
(
);
}
FILE
*
file
=
fdopen
(
file_descriptor
,
"wb"
);
if
(
!
file
)
{
perror
(
"Failed to open file descriptor."
);
close
(
file_descriptor
);
abort
(
);
}
const
size_t
bytes_written
=
fwrite
(
data
,
sizeof
(
uint8_t
),
size
,
file
);
if
(
bytes_written
<
size
)
{
close
(
file_descriptor
);
fprintf
(
stderr
,
"Failed to write all bytes to file (%zu out of %zu)"
,
bytes_written
,
size
);
abort
();
}
fclose
(
file
);
return
filename_buffer
;
static
char
*
fuzzer_get_tmpfile
(
const
uint8_t
*
data
,
size_t
size
)
{
char
*
filename_buffer
=
strdup
(
"/tmp/generate_temporary_file.XXXXXX"
);
if
(
!
filename_buffer
)
{
perror
(
"Failed to allocate file name buffer."
);
abort
();
}
const
int
file_descriptor
=
mkstemp
(
filename_buffer
);
if
(
file_descriptor
<
0
)
{
perror
(
"Failed to make temporary file."
);
abort
();
}
FILE
*
file
=
fdopen
(
file_descriptor
,
"wb"
);
if
(
!
file
)
{
perror
(
"Failed to open file descriptor."
);
close
(
file_descriptor
);
abort
();
}
const
size_t
bytes_written
=
fwrite
(
data
,
sizeof
(
uint8_t
),
size
,
file
);
if
(
bytes_written
<
size
)
{
close
(
file_descriptor
);
fprintf
(
stderr
,
"Failed to write all bytes to file (%zu out of %zu)"
,
bytes_written
,
size
);
abort
();
}
fclose
(
file
);
return
filename_buffer
;
}
static
void
fuzzer_release_tmpfile
(
char
*
filename
)
{
if
(
unlink
(
filename
)
!=
0
)
{
perror
(
"WARNING: Failed to delete temporary file."
);
}
free
(
filename
);
static
void
fuzzer_release_tmpfile
(
char
*
filename
)
{
if
(
unlink
(
filename
)
!=
0
)
{
perror
(
"WARNING: Failed to delete temporary file."
);
}
free
(
filename
);
}
// C++ RAII object for creating temporary files.
#ifdef __cplusplus
class
FuzzerTemporaryFile
{
public:
FuzzerTemporaryFile
(
const
uint8_t
*
data
,
size_t
size
)
:
filename_
(
fuzzer_get_tmpfile
(
data
,
size
))
{
}
class
FuzzerTemporaryFile
{
public:
FuzzerTemporaryFile
(
const
uint8_t
*
data
,
size_t
size
)
:
filename_
(
fuzzer_get_tmpfile
(
data
,
size
))
{
}
~
FuzzerTemporaryFile
()
{
fuzzer_release_tmpfile
(
filename_
);
}
~
FuzzerTemporaryFile
()
{
fuzzer_release_tmpfile
(
filename_
);
}
const
char
*
filename
()
const
{
return
filename_
;
}
const
char
*
filename
()
const
{
return
filename_
;
}
private:
char
*
filename_
;
private:
char
*
filename_
;
};
#endif
#endif
// FUZZER_TEMP_FILE_H_
#endif // FUZZER_TEMP_FILE_H_
glib/tests/fuzzing/label_fuzzer.c
View file @
979e51f7
#include <stdint.h>
#include <poppler.h>
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
GError
*
err
=
NULL
;
PopplerDocument
*
doc
;
PopplerPage
*
page
;
...
...
glib/tests/fuzzing/pdf_draw_fuzzer.c
View file @
979e51f7
...
...
@@ -5,7 +5,8 @@
#include "fuzzer_temp_file.h"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
GError
*
err
=
NULL
;
PopplerDocument
*
doc
;
PopplerPage
*
page
;
...
...
@@ -54,7 +55,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if
(
status
!=
CAIRO_STATUS_SUCCESS
)
{
g_object_unref
(
page
);
continue
;
}
if
(
hg
)
{
cairo_set_source_rgb
(
cr
,
0
.
6
,
0
.
6
,
1
.
0
);
...
...
glib/tests/fuzzing/util_fuzzer.c
View file @
979e51f7
#include <stdint.h>
#include <poppler.h>
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
gsize
length
;
poppler_named_dest_from_bytestring
(
data
,
size
);
poppler_named_dest_to_bytestring
(
data
,
&
length
);
...
...
qt5/tests/fuzzing/FuzzedDataProvider.h
View file @
979e51f7
This diff is collapsed.
Click to expand it.
qt5/tests/fuzzing/fuzzer_temp_file.h
View file @
979e51f7
...
...
@@ -26,56 +26,57 @@
// Pure-C interface for creating and cleaning up temporary files.
static
char
*
fuzzer_get_tmpfile
(
const
uint8_t
*
data
,
size_t
size
)
{
char
*
filename_buffer
=
strdup
(
"/tmp/generate_temporary_file.XXXXXX"
);
if
(
!
filename_buffer
)
{
perror
(
"Failed to allocate file name buffer."
);
abort
(
);
}
const
int
file_descriptor
=
mkstemp
(
filename_buffer
);
if
(
file_descriptor
<
0
)
{
perror
(
"Failed to make temporary file."
);
abort
(
);
}
FILE
*
file
=
fdopen
(
file_descriptor
,
"wb"
);
if
(
!
file
)
{
perror
(
"Failed to open file descriptor."
);
close
(
file_descriptor
);
abort
(
);
}
const
size_t
bytes_written
=
fwrite
(
data
,
sizeof
(
uint8_t
),
size
,
file
);
if
(
bytes_written
<
size
)
{
close
(
file_descriptor
);
fprintf
(
stderr
,
"Failed to write all bytes to file (%zu out of %zu)"
,
bytes_written
,
size
);
abort
();
}
fclose
(
file
);
return
filename_buffer
;
static
char
*
fuzzer_get_tmpfile
(
const
uint8_t
*
data
,
size_t
size
)
{
char
*
filename_buffer
=
strdup
(
"/tmp/generate_temporary_file.XXXXXX"
);
if
(
!
filename_buffer
)
{
perror
(
"Failed to allocate file name buffer."
);
abort
();
}
const
int
file_descriptor
=
mkstemp
(
filename_buffer
);
if
(
file_descriptor
<
0
)
{
perror
(
"Failed to make temporary file."
);
abort
();
}
FILE
*
file
=
fdopen
(
file_descriptor
,
"wb"
);
if
(
!
file
)
{
perror
(
"Failed to open file descriptor."
);
close
(
file_descriptor
);
abort
();
}
const
size_t
bytes_written
=
fwrite
(
data
,
sizeof
(
uint8_t
),
size
,
file
);
if
(
bytes_written
<
size
)
{
close
(
file_descriptor
);
fprintf
(
stderr
,
"Failed to write all bytes to file (%zu out of %zu)"
,
bytes_written
,
size
);
abort
();
}
fclose
(
file
);
return
filename_buffer
;
}
static
void
fuzzer_release_tmpfile
(
char
*
filename
)
{
if
(
unlink
(
filename
)
!=
0
)
{
perror
(
"WARNING: Failed to delete temporary file."
);
}
free
(
filename
);
static
void
fuzzer_release_tmpfile
(
char
*
filename
)
{
if
(
unlink
(
filename
)
!=
0
)
{
perror
(
"WARNING: Failed to delete temporary file."
);
}
free
(
filename
);
}
// C++ RAII object for creating temporary files.
#ifdef __cplusplus
class
FuzzerTemporaryFile
{
public:
FuzzerTemporaryFile
(
const
uint8_t
*
data
,
size_t
size
)
:
filename_
(
fuzzer_get_tmpfile
(
data
,
size
))
{
}
class
FuzzerTemporaryFile
{
public:
FuzzerTemporaryFile
(
const
uint8_t
*
data
,
size_t
size
)
:
filename_
(
fuzzer_get_tmpfile
(
data
,
size
))
{
}
~
FuzzerTemporaryFile
()
{
fuzzer_release_tmpfile
(
filename_
);
}
~
FuzzerTemporaryFile
()
{
fuzzer_release_tmpfile
(
filename_
);
}
const
char
*
filename
()
const
{
return
filename_
;
}
const
char
*
filename
()
const
{
return
filename_
;
}
private:
char
*
filename_
;
private:
char
*
filename_
;
};
#endif
#endif
// FUZZER_TEMP_FILE_H_
#endif // FUZZER_TEMP_FILE_H_
qt5/tests/fuzzing/qt_annot_fuzzer.cc
View file @
979e51f7
...
...
@@ -11,17 +11,17 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
const
QColor
color
=
QColor
::
fromRgb
(
0xAB
,
0xCD
,
0xEF
);
char
*
tmpfile
=
fuzzer_get_tmpfile
(
data
,
size
);
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
Poppler
::
Document
*
doc
=
Poppler
::
Document
::
loadFromData
(
in_data
);
if
(
!
doc
||
doc
->
isLocked
()){
if
(
!
doc
||
doc
->
isLocked
())
{
delete
doc
;
fuzzer_release_tmpfile
(
tmpfile
);
return
0
;
}
for
(
int
i
=
0
;
i
<
doc
->
numPages
();
i
++
)
{
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
if
(
!
p
)
{
continue
;
}
...
...
qt5/tests/fuzzing/qt_label_fuzzer.cc
View file @
979e51f7
...
...
@@ -7,16 +7,16 @@ static void dummy_error_function(const QString &, const QVariant &) { }
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
Poppler
::
setDebugErrorFunction
(
dummy_error_function
,
QVariant
());
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
Poppler
::
Document
*
doc
=
Poppler
::
Document
::
loadFromData
(
in_data
);
if
(
!
doc
||
doc
->
isLocked
()){
if
(
!
doc
||
doc
->
isLocked
())
{
delete
doc
;
return
0
;
}
for
(
int
i
=
0
;
i
<
doc
->
numPages
();
i
++
)
{
QString
label
=
QString
(
in_data
);
Poppler
::
Page
*
p
=
doc
->
page
(
label
);
Poppler
::
Page
*
p
=
doc
->
page
(
label
);
if
(
!
p
)
{
continue
;
}
...
...
qt5/tests/fuzzing/qt_pdf_fuzzer.cc
View file @
979e51f7
...
...
@@ -7,15 +7,15 @@ static void dummy_error_function(const QString &, const QVariant &) { }
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
Poppler
::
setDebugErrorFunction
(
dummy_error_function
,
QVariant
());
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
Poppler
::
Document
*
doc
=
Poppler
::
Document
::
loadFromData
(
in_data
);
if
(
!
doc
||
doc
->
isLocked
()){
if
(
!
doc
||
doc
->
isLocked
())
{
delete
doc
;
return
0
;
}
for
(
int
i
=
0
;
i
<
doc
->
numPages
();
i
++
)
{
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
if
(
!
p
)
{
continue
;
}
...
...
qt5/tests/fuzzing/qt_search_fuzzer.cc
View file @
979e51f7
...
...
@@ -6,15 +6,15 @@ static void dummy_error_function(const QString &, const QVariant &) { }
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
Poppler
::
setDebugErrorFunction
(
dummy_error_function
,
QVariant
());
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
Poppler
::
Document
*
doc
=
Poppler
::
Document
::
loadFromData
(
in_data
);
if
(
!
doc
||
doc
->
isLocked
()){
if
(
!
doc
||
doc
->
isLocked
())
{
delete
doc
;
return
0
;
}
for
(
int
i
=
0
;
i
<
doc
->
numPages
();
i
++
)
{
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
if
(
!
p
)
{
continue
;
}
...
...
qt5/tests/fuzzing/qt_textbox_fuzzer.cc
View file @
979e51f7
...
...
@@ -8,15 +8,15 @@ static void dummy_error_function(const QString &, const QVariant &) { }
extern
"C"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
Poppler
::
setDebugErrorFunction
(
dummy_error_function
,
QVariant
());
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
QByteArray
in_data
=
QByteArray
::
fromRawData
((
const
char
*
)
data
,
size
);
Poppler
::
Document
*
doc
=
Poppler
::
Document
::
loadFromData
(
in_data
);
if
(
!
doc
||
doc
->
isLocked
()){
if
(
!
doc
||
doc
->
isLocked
())
{
delete
doc
;
return
0
;
}
for
(
int
i
=
0
;
i
<
doc
->
numPages
();
i
++
)
{
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
Poppler
::
Page
*
p
=
doc
->
page
(
i
);
if
(
!
p
)
{
continue
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment