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

snmpusm.c:562:27: runtime error: null pointer passed as argument 1, which is declared to never be null #733

Closed
moshekaplan opened this issue Oct 17, 2023 · 2 comments

Comments

@moshekaplan
Copy link
Contributor

snmpusm.c:562:27: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/string.h:408:33: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior snmpusm.c:562:27 in 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==207555==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fc49237401d bp 0x7fff2dd1dc10 sp 0x7fff2dd1d3c8 T0)
==207555==The signal is caused by a READ memory access.
==207555==Hint: address points to the zero page.
    #0 0x7fc49237401d in __strlen_avx2 string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76
    #1 0x55c365f59829 in __interceptor_strlen (/home/user/Desktop/net-snmp/agent/.libs/snmpd+0x3d829) (BuildId: 805b58d3d7b3884d608aeb92ae1f51dd03baf716)
    #2 0x7fc493439127 in usm_add_user_to_list /home/user/Desktop/net-snmp/snmplib/snmpusm.c:562:20
    #3 0x7fc493439127 in usm_add_user /home/user/Desktop/net-snmp/snmplib/snmpusm.c:645:12
    #4 0x7fc49348a089 in usm_parse_config_usmUser /home/user/Desktop/net-snmp/snmplib/snmpusm.c:4357:9
    #5 0x7fc4931b4dd2 in run_config_handler /home/user/Desktop/net-snmp/snmplib/read_config.c:565:23
    #6 0x7fc4931aed81 in read_config /home/user/Desktop/net-snmp/snmplib/read_config.c:990:17
    #7 0x7fc4931bd15e in read_configs_optional /home/user/Desktop/net-snmp/snmplib/read_config.c:1048:18
    #8 0x7fc4931bdbdd in read_configs /home/user/Desktop/net-snmp/snmplib/read_config.c:1079:15
    #9 0x55c366008294 in main /home/user/Desktop/net-snmp/agent/snmpd.c:909:5
    #10 0x7fc492223a8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #11 0x7fc492223b48 in __libc_start_main csu/../csu/libc-start.c:360:3
    #12 0x55c365f427b4 in _start (/home/user/Desktop/net-snmp/agent/.libs/snmpd+0x267b4) (BuildId: 805b58d3d7b3884d608aeb92ae1f51dd03baf

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76 in __strlen_avx2
==207555==ABORTING

Triggering file:
fuzz_input.conf.txt
716)

@moshekaplan
Copy link
Contributor Author

moshekaplan commented Oct 17, 2023

snmpusm.c's lines 541 and 542 state:

    /* XXX - how to handle a NULL user->name ?? */
    /* XXX - similarly for a NULL nptr->name ?? */

This is exactly the issue: nptr->name is NULL here

@moshekaplan
Copy link
Contributor Author

Seems to have been fixed by #735 , closing.

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

1 participant