Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid memory address dereference in Image::RGB::RGB (in image.cpp:1239) #19

Closed
fantasy7082 opened this issue Feb 12, 2018 · 1 comment

Comments

@fantasy7082
Copy link

fantasy7082 commented Feb 12, 2018

Hi, i found a bug in the sam2p 0.49.4. It crashed in function Image::RGB::RGB.the details are below(ASAN):

> ./sam2p 007-unknown-add-refer EPS: /dev/null 
> This is sam2p 0.49.4.
> Available Loaders: PS PDF JAI PNG JPEG TIFF PNM BMP GIF LBM XPM PCX TGA.
> Available Appliers: XWD Meta Empty BMP PNG TIFF6 TIFF6-JAI JPEG-JAI JPEG PNM GIF89a+LZW XPM PSL1C PSL23+PDF PSL2+PDF-JAI P-TrOpBb.
> ASAN:SIGSEGV
> ==10156==ERROR: AddressSanitizer: SEGV on unknown address 0x10009e757d03 (pc 0x7ffff6ef6b73 bp 0x7fffffffd6b0 sp 0x7fffffffce40 T0)
>     #0 0x7ffff6ef6b72 in __asan_memset (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x8cb72)
>     #1 0x474210 in Image::RGB::RGB(unsigned int, unsigned int, unsigned char) /root/sam2p_ASAN2/sam2p/image.cpp:1239
>     #2 0x431fe6 in LoadPCX /root/sam2p_ASAN2/sam2p/in_pcx.cpp:213
>     #3 0x431fe6 in in_pcx_reader /root/sam2p_ASAN2/sam2p/in_pcx.cpp:533
>     #4 0x475999 in Image::load(Image::Loader::UFD*, SimBuffer::Flat const&, char const*) /root/sam2p_ASAN2/sam2p/image.cpp:1427
>     #5 0x40384a in run_sam2p_engine(Files::FILEW&, Files::FILEW&, char const* const*, bool) /root/sam2p_ASAN2/sam2p/sam2p_main.cpp:1055
>     #6 0x402463 in main /root/sam2p_ASAN2/sam2p/sam2p_main.cpp:1148
>     #7 0x7ffff6ac082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
>     #8 0x402d38 in _start (/usr/local/sam2p-asan2/bin/sam2p+0x402d38)
> 
> AddressSanitizer can not provide additional info.
> SUMMARY: AddressSanitizer: SEGV ??:0 __asan_memset
> ==10156==ABORTING

POC FILE: https://github.com/fantasy7082/image_test/blob/master/007-unknown-add-refer

@pts pts closed this as completed in b18d7b7 Feb 27, 2018
@pts
Copy link
Owner

pts commented Feb 27, 2018

Thank you for reporting this! Fixed in b18d7b7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants