Commit d54e2191 authored by Simon Middleton's avatar Simon Middleton
Browse files

Fixed the problem with 'debug_line' in 'debug_poll' being used for input and...

Fixed the problem with 'debug_line' in 'debug_poll' being used for input and output at the same time and this corrupting the argv[0] and causing crashes (apparently).

Version 0.01, 1.1.2.3. Tagged as 'remotedb-0_01-1_1_2_3'
parent 905b1c99
......@@ -121,7 +121,7 @@ export_hdrs:
${CP} h.${COMPONENT} ${DEBUGLIB}.h.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: export complete (hdrs)
export_libs: ${COMPONENT} ${COMPONENTZM} local_dirs
export_libs: ${COMPONENT} ${COMPONENTZM} ${LCOMPONENT} ${LCOMPONENTZM} local_dirs
${MKDIR} ${DEBUGLIB}
${MKDIR} ${DEBUGLIB}.o
${CP} ${COMPONENT} ${DEBUGLIB}.o.${COMPONENT} ${CPFLAGS}
......
......@@ -4,10 +4,11 @@
*
*/
#define Module_MajorVersion_CMHG 0.01
#define Module_MinorVersion_CMHG 1.1.2.2
#define Module_Date_CMHG 19 Jan 1998
#define Module_MinorVersion_CMHG 1.1.2.3
#define Module_Date_CMHG 20 Apr 1998
#define Module_MajorVersion "0.01"
#define Module_MinorVersion "1.1.2.2"
#define Module_Date "19 Jan 1998"
#define Module_Version 1
#define Module_MinorVersion "1.1.2.3"
#define Module_Date "20 Apr 1998"
......@@ -116,7 +116,7 @@ debug_poll(debug_session *sess)
/*
* what do we want to do
*/
if (argv[0][0]=='#') /* ignore comments */
if (argc == 0 || argv[0][0]=='#' || argv[0][0] == 0) /* ignore comments */
;
else if (caseless_strcmp(argv[0],"PRIORITY")==0)
{
......@@ -131,8 +131,12 @@ debug_poll(debug_session *sess)
}
else if (sess->cmd_handler) /* callback cmd handler if registered */
{
int rc = sess->cmd_handler(argc, argv, sess->cmd_handle);
debug_printf(sess,"(6) cmd '%s' returns %d\n",argv[0], rc);
char name[32];
int rc;
strncpy(name, argv[0], sizeof(name));
name[sizeof(name)-1] = 0;
rc = sess->cmd_handler(argc, argv, sess->cmd_handle);
debug_printf(sess,"(6) cmd '%s' returns %d\n", name, rc);
}
else
debug_printf(sess,"(6) unknown command '%s'\n",argv[0]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment