Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 8a6ba94 in mainline


Ignore:
Timestamp:
2011-08-21T13:02:27Z (10 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master
Children:
f90eb75
Parents:
d1e196f7
Message:

Fix stack overflow also in completion code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/compl.c

    rd1e196f7 r8a6ba94  
    9898        int retval;
    9999        tokenizer_t tok;
    100         token_t tokens[WORD_MAX];
     100        token_t *tokens = calloc(WORD_MAX, sizeof(token_t));
     101        if (tokens == NULL) {
     102                retval = ENOMEM;
     103                goto error;
     104        }
    101105        int current_token;
    102106        size_t tokens_length;
     
    254258        if (cs != NULL)
    255259                free(cs);
     260        if (tokens != NULL)
     261                free(tokens);
    256262
    257263        return retval;
Note: See TracChangeset for help on using the changeset viewer.