diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-29 06:49:36 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-29 06:49:36 +0000 |
commit | ab310e1b1c2f85235e61c471802b53314da919f0 (patch) | |
tree | 415cf40159a0c2b6009a27df18b0cc45bea2e956 /modutils/modutils-24.c | |
parent | 1cd1012a9063656a6b5b75dac8d400abd60cd643 (diff) | |
download | busybox-w32-ab310e1b1c2f85235e61c471802b53314da919f0.tar.gz busybox-w32-ab310e1b1c2f85235e61c471802b53314da919f0.tar.bz2 busybox-w32-ab310e1b1c2f85235e61c471802b53314da919f0.zip |
apply post-1.13.0 patches
Diffstat (limited to 'modutils/modutils-24.c')
-rw-r--r-- | modutils/modutils-24.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modutils/modutils-24.c b/modutils/modutils-24.c index 2bc4bda92..c6e7226cd 100644 --- a/modutils/modutils-24.c +++ b/modutils/modutils-24.c | |||
@@ -3236,8 +3236,10 @@ static struct obj_file *obj_load(FILE *fp, int loadprogbits UNUSED_PARAM) | |||
3236 | } | 3236 | } |
3237 | 3237 | ||
3238 | shnum = f->header.e_shnum; | 3238 | shnum = f->header.e_shnum; |
3239 | f->sections = xmalloc(sizeof(struct obj_section *) * shnum); | 3239 | /* Growth of ->sections vector will be done by |
3240 | memset(f->sections, 0, sizeof(struct obj_section *) * shnum); | 3240 | * xrealloc_vector(..., 2, ...), therefore we must allocate |
3241 | * at least 2^2 = 4 extra elements here. */ | ||
3242 | f->sections = xzalloc(sizeof(f->sections[0]) * (shnum + 4)); | ||
3241 | 3243 | ||
3242 | section_headers = alloca(sizeof(ElfW(Shdr)) * shnum); | 3244 | section_headers = alloca(sizeof(ElfW(Shdr)) * shnum); |
3243 | fseek(fp, f->header.e_shoff, SEEK_SET); | 3245 | fseek(fp, f->header.e_shoff, SEEK_SET); |