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

SEGV if sls is executed directly #115

Open
robertsong2019 opened this issue Mar 15, 2022 · 0 comments
Open

SEGV if sls is executed directly #115

robertsong2019 opened this issue Mar 15, 2022 · 0 comments

Comments

@robertsong2019
Copy link

Hello

if sls is executed directly, SEGV will received

Thread 1 "sls" received signal SIGSEGV, Segmentation fault.
0x0000000000409cb7 in sls_conf_release (c=0x0) at slscore/conf.cpp:360
360 if (c->child != NULL) {
(gdb) bt
#0 0x0000000000409cb7 in sls_conf_release (c=0x0) at slscore/conf.cpp:360
#1 0x0000000000409d7b in sls_conf_close () at slscore/conf.cpp:380
#2 0x0000000000404a26 in main (argc=1, argv=0x7fffffffe0a8) at srt-live-server.cpp:285
(gdb) q

Here is the patch to fix it, please check it.

diff --git a/slscore/conf.cpp b/slscore/conf.cpp
index 980d180..cf38e2e 100644
--- a/slscore/conf.cpp
+++ b/slscore/conf.cpp
@@ -357,6 +357,11 @@ int sls_conf_open(const char * conf_file)
 void sls_conf_release(sls_conf_base_t * c)
 {
     sls_conf_base_t * c_b;
+
+    if (c == NULL) {
+       return ;
+    }
+
     if (c->child != NULL) {
         c_b = c->child;
         sls_conf_release(c_b);

Best Regards

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