svn commit: branches/busybox_1_13_stable/modutils
vda at busybox.net
vda at busybox.net
Thu Feb 26 12:00:29 UTC 2009
Author: vda
Date: 2009-02-26 12:00:29 +0000 (Thu, 26 Feb 2009)
New Revision: 25461
Log:
modutils: overflow fix
Modified:
branches/busybox_1_13_stable/modutils/modutils.c
branches/busybox_1_13_stable/modutils/modutils.h
Changeset:
Modified: branches/busybox_1_13_stable/modutils/modutils.c
===================================================================
--- branches/busybox_1_13_stable/modutils/modutils.c 2009-02-26 11:57:01 UTC (rev 25460)
+++ branches/busybox_1_13_stable/modutils/modutils.c 2009-02-26 12:00:29 UTC (rev 25461)
@@ -71,7 +71,7 @@
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;
Modified: branches/busybox_1_13_stable/modutils/modutils.h
===================================================================
--- branches/busybox_1_13_stable/modutils/modutils.h 2009-02-26 11:57:01 UTC (rev 25460)
+++ branches/busybox_1_13_stable/modutils/modutils.h 2009-02-26 12:00:29 UTC (rev 25461)
@@ -16,8 +16,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;
More information about the busybox-cvs
mailing list