Changeset 42c2a80


Ignore:
Timestamp:
Jul 21, 2009, 8:28:40 PM (8 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
3e328b8
Parents:
7f6a8a2
git-author:
Anders Kaseorg <andersk@mit.edu> (07/21/09 20:24:06)
git-committer:
Anders Kaseorg <andersk@mit.edu> (07/21/09 20:28:40)
Message:
owl_command_multi: Fix crash on malformed multi command.

Test case:
:multi ( z

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rb4ef908 r42c2a80  
    16161616char *owl_command_multi(int argc, char **argv, char *buff)
    16171617{
    1618   char *lastrv = NULL, *dupbuff, *newbuff;
     1618  char *lastrv = NULL, *newbuff;
    16191619  char **commands;
    16201620  int  ncommands, i;
     
    16231623    return NULL;
    16241624  }
    1625   dupbuff = owl_strdup(buff);
    1626   newbuff = skiptokens(dupbuff, 1);
     1625  newbuff = owl_strdup(skiptokens(buff, 1));
    16271626  if (!strcmp(argv[0], "(")) {
    16281627    for (i=strlen(newbuff)-1; i>=0; i--) {
     
    16441643    lastrv = owl_function_command(commands[i]);
    16451644  }
    1646   owl_free(dupbuff);
     1645  owl_free(newbuff);
    16471646  atokenize_free(commands, ncommands);
    16481647  return lastrv;
Note: See TracChangeset for help on using the changeset viewer.