git.samba.org
/
sfrench
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1766f77
)
printing: Fix CID 1435452 (TAINTED_SCALAR)
author
Volker Lendecke
<vl@samba.org>
Tue, 8 May 2018 06:41:04 +0000
(08:41 +0200)
committer
Jeremy Allison
<jra@samba.org>
Fri, 11 May 2018 18:33:13 +0000
(20:33 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
source3/printing/nt_printing.c
patch
|
blob
|
history
diff --git
a/source3/printing/nt_printing.c
b/source3/printing/nt_printing.c
index 395f7b87da624d0572d79c2cabde128aba6179f5..1639bfd440661e91a8d93d2519d6724e68d0104c 100644
(file)
--- a/
source3/printing/nt_printing.c
+++ b/
source3/printing/nt_printing.c
@@
-390,6
+390,12
@@
static int handle_pe_file(files_struct *fsp,
/* get the section table */
num_sections = SVAL(buf,PE_HEADER_NUMBER_OF_SECTIONS);
+
+ if (num_sections >= (UINT_MAX / PE_HEADER_SECT_HEADER_SIZE)) {
+ /* Integer wrap. */
+ goto out;
+ }
+
section_table_bytes = num_sections * PE_HEADER_SECT_HEADER_SIZE;
if (section_table_bytes == 0) {
goto out;