Bug#868554: pehash: segmentation fault

2017-07-16 Thread Jakub Wilk

Control: forwarded -1 https://github.com/merces/pev/pull/110

I've forwarded the patch upstream.

--
Jakub Wilk



Processed: Re: Bug#868554: pehash: segmentation fault

2017-07-16 Thread Debian Bug Tracking System
Processing control commands:

> forwarded -1 https://github.com/merces/pev/pull/110
Bug #868554 {Done: Petter Reinholdtsen } [pev] pehash: 
segmentation fault
Set Bug forwarded-to-address to 'https://github.com/merces/pev/pull/110'.

-- 
868554: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868554
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#868554: pehash: segmentation fault

2017-07-16 Thread Petter Reinholdtsen

[Jakub Wilk]
> I've forwarded the patch upstream.

Thank you.  I've uploaded a fixed version to unstable.

-- 
Happy hacking
Petter Reinholdtsen



Bug#868554: pehash: segmentation fault

2017-07-16 Thread Jakub Wilk

Control: tags -1 + patch

The attached patch fixes it for me.

The const annotation is bogus, because this variable is going to be modified in 
the next line.


* Adrian Bunk , 2017-07-16, 19:10:

$ pescan test.exe
file entropy:5.924796 (normal)
fpu anti-disassembly:no
imagebase:   normal
entrypoint:  normal
DOS stub:normal
TLS directory:   found - 1 function(s)
timestamp:   normal
section count:   15 (high)
Segmentation fault


Good catch. My patch seems to fix this, too.

--
Jakub Wilk
--- a/src/output.c
+++ b/src/output.c
@@ -288,7 +288,7 @@
 	scope->depth = scope_depth + 1;
 
 	if (scope_depth > 0) {
-		output_scope_t * const parent_scope = NULL;
+		output_scope_t * parent_scope = NULL;
 		STACK_PEEK(g_scope_stack, (void *)_scope);
 		scope->parent_type = parent_scope->type;
 	}


Processed: Re: Bug#868554: pehash: segmentation fault

2017-07-16 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 + patch
Bug #868554 [pev] pehash: segmentation fault
Added tag(s) patch.

-- 
868554: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868554
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: Re: Bug#868554: pehash: segmentation fault

2017-07-16 Thread Debian Bug Tracking System
Processing control commands:

> severity -1 serious
Bug #868554 [pev] pehash: segmentation fault
Severity set to 'serious' from 'normal'

-- 
868554: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868554
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#868554: pehash: segmentation fault

2017-07-16 Thread Adrian Bunk
Control: severity -1 serious

On Sun, Jul 16, 2017 at 04:55:24PM +0200, Jakub Wilk wrote:
> Package: pev
> Version: 0.80-2
> 
> pehash seems to crash on every file:
> 
>   $ echo 'int main(int argc, char **argv) {}' | i686-w64-mingw32-gcc -x c - 
> -o test.exe
>   $ pehash test.exe
>   Segmentation fault
> 
> Backtrace:
> 
> #0  output_open_scope (scope_name=0x5655add8 "file", 
> scope_type=OUTPUT_SCOPE_TYPE_OBJECT) at output.c:293
> #1  0x56556f42 in main (argc=, argv=) at 
> pehash.c:557

pehash is not the only program that segfaults:

$ pescan --version
pescan from pev 0.50  toolkit
Copyright (C) 2012 Fernando Mercês.
License GPLv3+: GNU GPL version 3 or later 
.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ pescan test.exe 
entrypoint:  normal
DOS stub:normal
TLS directory:   found - 2 function(s)
Sections:15 - suspicious
$ 

$ pescan --version
pescan from pev 0.80  toolkit
License GPLv2+: GNU GPL version 2 or later 
.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ pescan test.exe 
file entropy:5.924796 (normal)
fpu anti-disassembly:no
imagebase:   normal
entrypoint:  normal
DOS stub:normal
TLS directory:   found - 1 function(s)
timestamp:   normal
section count:   15 (high)
Segmentation fault
$

Raising severity to keep the broken version out of buster.

> Jakub Wilk

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed



Bug#868554: pehash: segmentation fault

2017-07-16 Thread Jakub Wilk

Package: pev
Version: 0.80-2

pehash seems to crash on every file:

  $ echo 'int main(int argc, char **argv) {}' | i686-w64-mingw32-gcc -x c - -o 
test.exe
  $ pehash test.exe
  Segmentation fault

Backtrace:

#0  output_open_scope (scope_name=0x5655add8 "file", 
scope_type=OUTPUT_SCOPE_TYPE_OBJECT) at output.c:293
#1  0x56556f42 in main (argc=, argv=) at 
pehash.c:557


-- System Information:
Architecture: i386

Versions of packages pev depends on:
ii  libc62.24-12
ii  libssl1.0.2  1.0.2l-2

--
Jakub Wilk