aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-02-26 12:00:52 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-02-26 12:00:52 +0000
commit48637e0924dcd13629ebf3aeffa80cdda1beb5af (patch)
tree5a3eaec93fc5c5f1b29598c50e6f70851eff06db /modutils
parent9aa5c652e9335650428fddc0b84037853a06256c (diff)
downloadbusybox-48637e0924dcd13629ebf3aeffa80cdda1beb5af.tar.gz
modutils: oveflow fix
Diffstat (limited to 'modutils')
-rw-r--r--modutils/modutils.c2
-rw-r--r--modutils/modutils.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/modutils/modutils.c b/modutils/modutils.c
index 0d7d72d8b..8836f7c69 100644
--- a/modutils/modutils.c
+++ b/modutils/modutils.c
@@ -71,7 +71,7 @@ char * FAST_FUNC filename2modname(const char *filename, char *modname)
if (modname == NULL)
modname = xmalloc(MODULE_NAME_LEN);
from = bb_get_last_path_component_nostrip(filename);
- for (i = 0; i < MODULE_NAME_LEN && from[i] != '\0' && from[i] != '.'; i++)
+ for (i = 0; i < (MODULE_NAME_LEN-1) && from[i] != '\0' && from[i] != '.'; i++)
modname[i] = (from[i] == '-') ? '_' : from[i];
modname[i] = 0;
diff --git a/modutils/modutils.h b/modutils/modutils.h
index 6aaf79daa..cc7c65351 100644
--- a/modutils/modutils.h
+++ b/modutils/modutils.h
@@ -15,8 +15,9 @@
# pragma GCC visibility push(hidden)
#endif
-/* As defined in linux/include/linux/module.h */
-#define MODULE_NAME_LEN 64
+/* linux/include/linux/module.h has 64, but this is also used
+ * internally for the maximum alias name length, which can be quite long */
+#define MODULE_NAME_LEN 256
const char *moderror(int err) FAST_FUNC;
llist_t *llist_find(llist_t *first, const char *str) FAST_FUNC;