summaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorDenis Vlasenko2008-11-29 06:49:36 +0000
committerDenis Vlasenko2008-11-29 06:49:36 +0000
commitab310e1b1c2f85235e61c471802b53314da919f0 (patch)
tree415cf40159a0c2b6009a27df18b0cc45bea2e956 /modutils
parent1cd1012a9063656a6b5b75dac8d400abd60cd643 (diff)
downloadbusybox-ab310e1b1c2f85235e61c471802b53314da919f0.zip
busybox-ab310e1b1c2f85235e61c471802b53314da919f0.tar.gz
apply post-1.13.0 patches
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modprobe-small.c18
-rw-r--r--modutils/modutils-24.c6
2 files changed, 15 insertions, 9 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 96a0a08..d3fde0e 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -600,18 +600,22 @@ static void process_module(char *name, const char *cmdline_options)
free(deps);
/* modprobe -> load it */
- if (!is_rmmod && (options && !strstr(options, "blacklist"))) {
- errno = 0;
- if (load_module(info->pathname, options) != 0) {
- if (EEXIST != errno) {
- bb_error_msg("'%s': %s",
+ if (!is_rmmod) {
+ if (!options || strstr(options, "blacklist") == NULL) {
+ errno = 0;
+ if (load_module(info->pathname, options) != 0) {
+ if (EEXIST != errno) {
+ bb_error_msg("'%s': %s",
info->pathname,
moderror(errno));
- } else {
- dbg1_error_msg("'%s': %s",
+ } else {
+ dbg1_error_msg("'%s': %s",
info->pathname,
moderror(errno));
+ }
}
+ } else {
+ dbg1_error_msg("'%s': blacklisted", info->pathname);
}
}
ret:
diff --git a/modutils/modutils-24.c b/modutils/modutils-24.c
index 2bc4bda..c6e7226 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)
}
shnum = f->header.e_shnum;
- f->sections = xmalloc(sizeof(struct obj_section *) * shnum);
- memset(f->sections, 0, sizeof(struct obj_section *) * shnum);
+ /* Growth of ->sections vector will be done by
+ * xrealloc_vector(..., 2, ...), therefore we must allocate
+ * at least 2^2 = 4 extra elements here. */
+ f->sections = xzalloc(sizeof(f->sections[0]) * (shnum + 4));
section_headers = alloca(sizeof(ElfW(Shdr)) * shnum);
fseek(fp, f->header.e_shoff, SEEK_SET);