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

res_rpt_http_registrations: NULL dereference in http_register #353

Open
Allan-N opened this issue Jul 10, 2024 · 1 comment · May be fixed by #355
Open

res_rpt_http_registrations: NULL dereference in http_register #353

Allan-N opened this issue Jul 10, 2024 · 1 comment · May be fixed by #355
Assignees
Labels
bug Something isn't working

Comments

@Allan-N
Copy link
Collaborator

Allan-N commented Jul 10, 2024

From a corefile :

!@!@!@! brief.txt !@!@!@!

$2 = {si_signo = 11, si_errno = 0, si_code = 1, _sifields = {_pad = {0 <repeats 28 times>}, _kill = {si_pid = 0, si_uid = 0}, _timer = {si_tid = 0, si_overrun = 0, si_sigval = {sival_int = 0, sival_ptr = 0x0}}, _rt = {si_pid = 0, si_uid = 0, si_sigval = {sival_int = 0, sival_ptr = 0x0}}, _sigchld = {si_pid = 0, si_uid = 0, si_status = 0, si_utime = 0, si_stime = 0}, _sigfault = {si_addr = 0x0}, _sigpoll = {si_band = 0, si_fd = 0}, _sigsys = {_call_addr = 0x0, _syscall = 0, _arch = 0}}}
Signal        Stop	Print	Pass to program	Description
SIGSEGV       Yes	Yes	Yes		Segmentation fault
...
Thread 1 (Thread 0x7f3896f040 (LWP 13981)):
#0  index () at ../sysdeps/aarch64/strchr.S:62
#1  0x0000007f872c6e70 in __GI_strstr (haystack=haystack@entry=0x0, needle=needle@entry=0x7f39863838 "successfully registered") at ./string/strstr.c:84
#2  0x0000007f3986231c in http_register (reg=0x5570ab60d0) at ./res/res_rpt_http_registrations.c:253
#3  do_refresh (varg=varg@entry=0x0) at ./res/res_rpt_http_registrations.c:289
#4  0x000000556624537c in dummy_start (data=<optimized out>) at ./main/utils.c:1607
#5  0x0000007f872aee58 in start_thread (arg=0x7fed1e3ca7) at ./nptl/pthread_create.c:442
#6  0x0000007f87317f9c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79
@Allan-N Allan-N self-assigned this Jul 10, 2024
@InterLinked1 InterLinked1 changed the title Restarting asterisk (w/systemctl restart asterisk) can trigger SEGV res_rpt_http_registrations: Possible NULL dereference in http_register Jul 10, 2024
@InterLinked1 InterLinked1 added the bug Something isn't working label Jul 10, 2024
@Allan-N Allan-N changed the title res_rpt_http_registrations: Possible NULL dereference in http_register res_rpt_http_registrations: NULL dereference in http_register Jul 11, 2024
@Allan-N
Copy link
Collaborator Author

Allan-N commented Jul 13, 2024

Here's a shell script that (for me) shows the issue with unexpected registration response. In the first case we get back a response with the expected "data" element. In the second case, there is no "data" element ... and that's what the code had expected to be present. Probably need to look at the server code but we also should ensure that the client will not crash.

Note: I had to add the ".txt" extension to the filename in order to upload to GitHub

rpt_http_test.sh.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants