Skip to content

Conversation

13579and2468
Copy link

@13579and2468 13579and2468 commented Jul 1, 2022

compile it with asan

git clone https://github.com/netwide-assembler/nasm.git
cd nasm
sh autogen.sh;
AFL_USE_ASAN=1 ./configure CC=afl-gcc CXX=afl-g++ LD=afl-gcc--disable-shared;
AFL_USE_ASAN=1 make;

run

$ ./nasm myinput/test1  
myinput/test1: warning: default output file same as input, using `nasm.out' for output
 [-w+other]
nasm: fatal: unable to open input file `myinput/test1' No such file or directory

=================================================================
==14512==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 14 byte(s) in 1 object(s) allocated from:
    #0 0x7f10ccd7a808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x559a339ff044 in nasm_malloc nasmlib/alloc.c:55

SUMMARY: AddressSanitizer: 14 byte(s) leaked in 1 allocation(s).

Analysis :

When the first argument of nasm is a pathname without '.', forget to free outname before set outname = "nasm.out";.

Copy link
Contributor

@cyrillos cyrillos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, but please make the proper changelog, see example here https://nasm.us/patches.php

Bug analysis:
	When the first argument of nasm is a pathname without '.', forget to free outname before set outname = "nasm.out";.

bugzilla: https://bugzilla.nasm.us/show_bug.cgi?id=3392800
Signed-off-by: Szu-Wei Tseng <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants