VirtualBox

Changeset 2809 in kBuild


Ignore:
Timestamp:
Feb 5, 2016 9:13:42 AM (9 years ago)
Author:
bird
Message:

kash: sh_clone_string_vector: malloc + 1 size bug spotted by Frank & gcc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shinstance.c

    r2784 r2809  
    182182
    183183/**
    184  * Clones a string vector like enviorn or argv.
     184 * Clones a string vector like environ or argv.
    185185 *
    186186 * @returns 0 on success, -1 and errno on failure.
     
    200200
    201201   /* alloc clone array. */
    202    *dstp = dst = sh_malloc(psh, sizeof(*dst) * items + 1);
     202   *dstp = dst = sh_malloc(psh, sizeof(*dst) * (items + 1));
    203203   if (!dst)
    204204       return -1;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette