Fix to bug #673, http://bugs.skysql.com/show_bug.cgi?id=673
dcb.c:dcb_hashtable_stats:division by zero hashtable.c:hashtable_get_stats: NULL-pointer reference service.c:serviceStartPort:set service->users NULL to avoid referring to freed memory users.c:dcb_usersPrintf: NULL-pointer reference debugcmd.c:convert_arg: changed return value to 1 in case of error, 0 (==NULL) is valid but it indicates that there are no users loaded. execute_cmd: fixed command handling
This commit is contained in:
@ -678,7 +678,7 @@ SERVICE *service;
|
||||
if (service)
|
||||
return (unsigned long)(service->users);
|
||||
else
|
||||
return 0;
|
||||
return 1; /*< invalid argument */
|
||||
}
|
||||
return rval;
|
||||
case ARG_TYPE_DCB:
|
||||
@ -886,11 +886,15 @@ bool in_space = false;
|
||||
break;
|
||||
case 1:
|
||||
arg1 = convert_arg(cli->mode, args[2],cmds[i].options[j].arg_types[0]);
|
||||
if (arg1)
|
||||
cmds[i].options[j].fn(dcb, arg1);
|
||||
else
|
||||
if (arg1 == 0x1)
|
||||
{
|
||||
dcb_printf(dcb, "Invalid argument: %s\n",
|
||||
args[2]);
|
||||
args[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmds[i].options[j].fn(dcb, arg1);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
arg1 = convert_arg(cli->mode, args[2],cmds[i].options[j].arg_types[0]);
|
||||
|
Reference in New Issue
Block a user