[Home]

Summary:ASTERISK-08104: ExtenSpy segfault on no given argument to spy from.
Reporter:Ronald Chan (loloski)Labels:
Date Opened:2006-11-10 04:09:38.000-0600Date Closed:2006-11-10 10:55:24.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_chanspy
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:   -- Executing [209@internal:1] ExtenSpy("SIP/201-08d14368", "|v(4)q") in new stack
stealth*CLI>
Disconnected from Asterisk server
/usr/sbin/safe_asterisk: line 42: 13517 Segmentation fault      (core dumped) ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >&/dev/${TTY} </dev/${TTY}
Asterisk ended with exit status 139
Asterisk exited on signal 11.
Automatically restarting Asterisk.


****** ADDITIONAL INFORMATION ******

if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
               context = argv[0];
               exten = strsep(&context, "@");
               if (ast_strlen_zero(context))
                       context = ast_strdupa(chan->context);
               if (argc > 1)
                       options = argv[1];
       }

at quick glance the problem is there is no error checking if the specified channel and context to spy from is != NULL.

Since i'm not a real C person, could someone check this out please.


Best regards,

Ronald

Comments:By: Ronald Chan (loloski) 2006-11-10 06:28:22.000-0600

i think we should not let the user to use this apps, if they fail to supply a valid exten to spy from.

[internal]

exten => 209,1,ExtenSpy(|v(4)q)

*/ i think this should not cause segfault but rather inform our user to check
their arguments IMHO/*

if you think this is not a bug but a user error you can close this now. thanks

Ronald

By: Ronald Chan (loloski) 2006-11-10 06:35:10.000-0600

snip*

at quick glance the problem is there is no error checking if the specified channel and context to spy from is != NULL.

correction a valid *extension* to spy from and if i understand correctly if they ommit to put the context it assume on the current running context right ? :)

sorry i hope nobody will confuse this :)

By: Joshua C. Colp (jcolp) 2006-11-10 10:55:23.000-0600

Fixed in 1.4 as of revision 47437 and trunk as of revision 47438. Thanks!