mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
cmd_get_params() crashed in some conditions
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1489 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
0ec7e8ed58
commit
f1774f1a3b
@ -649,6 +649,7 @@ static char *get_optional_channel(CHANNEL_REC *active_channel, char **data)
|
||||
|
||||
int cmd_get_params(const char *data, gpointer *free_me, int count, ...)
|
||||
{
|
||||
CHANNEL_REC *chanrec;
|
||||
CMD_TEMP_REC *rec;
|
||||
GHashTable **opthash;
|
||||
char **str, *arg, *datad;
|
||||
@ -665,6 +666,10 @@ int cmd_get_params(const char *data, gpointer *free_me, int count, ...)
|
||||
|
||||
datad = rec->data;
|
||||
error = FALSE;
|
||||
|
||||
chanrec = (count & PARAM_FLAG_OPTCHAN) == 0 ? NULL:
|
||||
(CHANNEL_REC *) va_arg(args, CHANNEL_REC *);
|
||||
|
||||
if (count & PARAM_FLAG_OPTIONS) {
|
||||
arg = (char *) va_arg(args, char *);
|
||||
opthash = (GHashTable **) va_arg(args, GHashTable **);
|
||||
@ -683,9 +688,6 @@ int cmd_get_params(const char *data, gpointer *free_me, int count, ...)
|
||||
cnt = PARAM_WITHOUT_FLAGS(count);
|
||||
if (count & PARAM_FLAG_OPTCHAN) {
|
||||
/* optional channel as first parameter */
|
||||
CHANNEL_REC *chanrec;
|
||||
|
||||
chanrec = (CHANNEL_REC *) va_arg(args, CHANNEL_REC *);
|
||||
arg = get_optional_channel(chanrec, &datad);
|
||||
|
||||
str = (char **) va_arg(args, char **);
|
||||
|
Loading…
Reference in New Issue
Block a user