aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli.c
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-05 17:39:20 +0100
committerErwan Velu <erwan.velu@free.fr>2009-11-05 17:39:20 +0100
commit4cedaeb54b19d8560b19aac25e86cf1d52fdc606 (patch)
treec0332917c05a427aad21a11cec1c32d05a998146 /com32/hdt/hdt-cli.c
parente4e28b8fd43a971466ff38b243784d20437d6252 (diff)
downloadsyslinux-4cedaeb54b19d8560b19aac25e86cf1d52fdc606.tar.gz
syslinux-4cedaeb54b19d8560b19aac25e86cf1d52fdc606.tar.xz
syslinux-4cedaeb54b19d8560b19aac25e86cf1d52fdc606.zip
hdt: Prevent auto mode from using empty commands
Impact: prevent running stupid commands The code didn't prevents from executing stupid "'" commands
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 f395260f..fdb10e4a 100644
--- a/com32/hdt/hdt-cli.c
+++ b/com32/hdt/hdt-cli.c
@@ -763,7 +763,7 @@ void start_auto_mode(struct s_hardware *hardware)
/* Searching & saving all commands */
mypch = strtok (temp,AUTO_SEPARATOR);
while (mypch != NULL) {
- if (strlen(remove_spaces(mypch))>0) {
+ if ((strlen(remove_spaces(mypch))>0) && (remove_spaces(mypch)[0] !='\'')) {
nb_commands++;
if ((commands[nb_commands]=malloc(AUTO_COMMAND_SIZE)) != NULL) {
sprintf(commands[nb_commands],"%s",remove_spaces(mypch));