aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-11-16 14:23:45 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-11-27 20:47:28 +0000
commitd43c57d945f42dd0dbaca747a646a769e49082da (patch)
treecf574d81498463980d11ae511e7bc981aefbcb4a /com32/hdt/hdt-cli.c
parent39acf04ff0eda2e86b53187bee31c6c67e058491 (diff)
downloadsyslinux-d43c57d945f42dd0dbaca747a646a769e49082da.tar.gz
syslinux-d43c57d945f42dd0dbaca747a646a769e49082da.tar.xz
syslinux-d43c57d945f42dd0dbaca747a646a769e49082da.zip
hdt-cli: Correct malloc() size argument
We need to be allocating sizeof(char *) (4) not sizeof(char) (1) for 'new_argv'. Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/hdt/hdt-cli.c')
-rw-r--r--com32/hdt/hdt-cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c
index 7542da83..216b6bde 100644
--- a/com32/hdt/hdt-cli.c
+++ b/com32/hdt/hdt-cli.c
@@ -649,7 +649,7 @@ static void exec_command(char *line, struct s_hardware *hardware)
if ((current_module->nomodule == true) && ( module != NULL)) {
dprintf("CLI_DEBUG exec: Reworking arguments with argc=%d\n",argc);
char **new_argv=NULL;
- new_argv=malloc((argc + 2)*sizeof(char));
+ new_argv=malloc((argc + 2)*sizeof(char *));
for (int argc_iter=0; argc_iter<argc; argc_iter++) {
dprintf("CLI_DEBUG exec rework : copy %d to %d (%s)\n",argc_iter,argc_iter+1,argv[argc_iter]);
new_argv[argc_iter+1] = malloc(strlen(argv[argc_iter]));