summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-08-09 21:29:34 +0000
committerErik Troan <ewt@redhat.com>1999-08-09 21:29:34 +0000
commit88bca53c1fefd529dc6664a6aac1c3f5ea5f601b (patch)
treeae1c575a8078855effc4c1bdc33d82995dedf5f9 /isys
parentbd2de79c57673f5168af1be3d559a8522972dfd1 (diff)
downloadanaconda-88bca53c1fefd529dc6664a6aac1c3f5ea5f601b.tar.gz
anaconda-88bca53c1fefd529dc6664a6aac1c3f5ea5f601b.tar.xz
anaconda-88bca53c1fefd529dc6664a6aac1c3f5ea5f601b.zip
parameters weren't passed properly
Diffstat (limited to 'isys')
-rw-r--r--isys/otherinsmod.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/isys/otherinsmod.c b/isys/otherinsmod.c
index f052ed16c..190a36cf5 100644
--- a/isys/otherinsmod.c
+++ b/isys/otherinsmod.c
@@ -106,14 +106,18 @@ int insmod(char * modName, char ** args) {
pid_t child;
int status;
- argc = 2;
+
+ argc = 0;
for (argv = args; argv && *argv; argv++, argc++);
- argv = malloc(sizeof(*argv) * (argc + 1));
+ argv = alloca(sizeof(*argv) * (argc + 3));
argv[0] = "/bin/insmod";
argv[1] = modName;
if (args)
- memcpy(argv + 2, args, argc - 1);
+ memcpy(argv + 2, args, sizeof(*args) * argc);
+ argv[argc + 2] = NULL;
+
+ argc += 2;
if ((child = fork()) == 0) {
exit(ourInsmodCommand(argc, argv));