diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-06-18 05:16:25 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-06-18 05:16:25 +0000 |
commit | 2d34215456def242968e5b545245d5d6ec4af432 (patch) | |
tree | 64393e7bf35206d54049f30504bf31a2bb1c45db /modutils | |
parent | b0fd2b06a32a0a8a70a65e1cacf70104afc83faa (diff) | |
download | busybox-w32-2d34215456def242968e5b545245d5d6ec4af432.tar.gz busybox-w32-2d34215456def242968e5b545245d5d6ec4af432.tar.bz2 busybox-w32-2d34215456def242968e5b545245d5d6ec4af432.zip |
As noted by Yves Lavoie ing. <yves.lavoie.ing@sympatico.ca>, don't
lose the last letter of the module name.
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/insmod.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c index c89cd3c8d..e65f874ea 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -233,7 +233,7 @@ | |||
233 | #ifndef MODUTILS_MODULE_H | 233 | #ifndef MODUTILS_MODULE_H |
234 | static const int MODUTILS_MODULE_H = 1; | 234 | static const int MODUTILS_MODULE_H = 1; |
235 | 235 | ||
236 | #ident "$Id: insmod.c,v 1.84 2002/06/06 14:24:57 andersen Exp $" | 236 | #ident "$Id: insmod.c,v 1.85 2002/06/18 05:16:25 andersen Exp $" |
237 | 237 | ||
238 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 238 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
239 | We do not use the kernel headers directly because we do not wish | 239 | We do not use the kernel headers directly because we do not wish |
@@ -454,7 +454,7 @@ int delete_module(const char *); | |||
454 | #ifndef MODUTILS_OBJ_H | 454 | #ifndef MODUTILS_OBJ_H |
455 | static const int MODUTILS_OBJ_H = 1; | 455 | static const int MODUTILS_OBJ_H = 1; |
456 | 456 | ||
457 | #ident "$Id: insmod.c,v 1.84 2002/06/06 14:24:57 andersen Exp $" | 457 | #ident "$Id: insmod.c,v 1.85 2002/06/18 05:16:25 andersen Exp $" |
458 | 458 | ||
459 | /* The relocatable object is manipulated using elfin types. */ | 459 | /* The relocatable object is manipulated using elfin types. */ |
460 | 460 | ||
@@ -738,8 +738,8 @@ static int n_ext_modules; | |||
738 | static int n_ext_modules_used; | 738 | static int n_ext_modules_used; |
739 | extern int delete_module(const char *); | 739 | extern int delete_module(const char *); |
740 | 740 | ||
741 | static char m_filename[FILENAME_MAX + 1]; | 741 | static char m_filename[FILENAME_MAX]; |
742 | static char m_fullName[FILENAME_MAX + 1]; | 742 | static char m_fullName[FILENAME_MAX]; |
743 | 743 | ||
744 | 744 | ||
745 | 745 | ||
@@ -2010,7 +2010,7 @@ old_get_module_version(struct obj_file *f, char str[STRVERSIONLEN]) | |||
2010 | return -1; | 2010 | return -1; |
2011 | 2011 | ||
2012 | p = f->sections[sym->secidx]->contents + sym->value; | 2012 | p = f->sections[sym->secidx]->contents + sym->value; |
2013 | strncpy(str, p, STRVERSIONLEN); | 2013 | safe_strncpy(str, p, STRVERSIONLEN); |
2014 | 2014 | ||
2015 | a = strtoul(p, &p, 10); | 2015 | a = strtoul(p, &p, 10); |
2016 | if (*p != '.') | 2016 | if (*p != '.') |
@@ -2505,7 +2505,7 @@ new_get_module_version(struct obj_file *f, char str[STRVERSIONLEN]) | |||
2505 | p = get_modinfo_value(f, "kernel_version"); | 2505 | p = get_modinfo_value(f, "kernel_version"); |
2506 | if (p == NULL) | 2506 | if (p == NULL) |
2507 | return -1; | 2507 | return -1; |
2508 | strncpy(str, p, STRVERSIONLEN); | 2508 | safe_strncpy(str, p, STRVERSIONLEN); |
2509 | 2509 | ||
2510 | a = strtoul(p, &p, 10); | 2510 | a = strtoul(p, &p, 10); |
2511 | if (*p != '.') | 2511 | if (*p != '.') |
@@ -3432,7 +3432,7 @@ extern int insmod_main( int argc, char **argv) | |||
3432 | FILE *fp; | 3432 | FILE *fp; |
3433 | struct obj_file *f; | 3433 | struct obj_file *f; |
3434 | struct stat st; | 3434 | struct stat st; |
3435 | char m_name[FILENAME_MAX + 1] = "\0"; | 3435 | char m_name[FILENAME_MAX] = "\0"; |
3436 | int exit_status = EXIT_FAILURE; | 3436 | int exit_status = EXIT_FAILURE; |
3437 | int m_has_modinfo; | 3437 | int m_has_modinfo; |
3438 | #ifdef CONFIG_FEATURE_INSMOD_VERSION_CHECKING | 3438 | #ifdef CONFIG_FEATURE_INSMOD_VERSION_CHECKING |
@@ -3490,6 +3490,9 @@ extern int insmod_main( int argc, char **argv) | |||
3490 | len-=2; | 3490 | len-=2; |
3491 | tmp[len] = '\0'; | 3491 | tmp[len] = '\0'; |
3492 | } | 3492 | } |
3493 | /* Make sure there is space for the terminal NULL */ | ||
3494 | len += 1; | ||
3495 | |||
3493 | if (len >= sizeof(m_fullName)) { | 3496 | if (len >= sizeof(m_fullName)) { |
3494 | len = sizeof(m_fullName); | 3497 | len = sizeof(m_fullName); |
3495 | } | 3498 | } |