summaryrefslogtreecommitdiff
path: root/com32/lib/syslinux/run_command.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-02-24 14:18:49 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-02-24 14:18:49 -0800
commit8a4b35805fdc6651d288a3e1c2d98aa504cb9c05 (patch)
tree37c4bdef99996ab681e03c7a3f407563a9ff35d7 /com32/lib/syslinux/run_command.c
parent3ae1da98a68d2f719ce17766550f7e9682ba8ae7 (diff)
downloadsyslinux-8a4b35805fdc6651d288a3e1c2d98aa504cb9c05.tar.gz
com32: replace hard-coded bounce buffer use in com32/libsyslinux-4.00-pre25
Replace hard-coded bounce buffer uses in com32/lib with lmalloc/lfree. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib/syslinux/run_command.c')
-rw-r--r--com32/lib/syslinux/run_command.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/com32/lib/syslinux/run_command.c b/com32/lib/syslinux/run_command.c
index 4693e16d..a0ac9a0d 100644
--- a/com32/lib/syslinux/run_command.c
+++ b/com32/lib/syslinux/run_command.c
@@ -30,18 +30,21 @@
#include <string.h>
#include <com32.h>
-__noreturn syslinux_run_command(const char *command)
+int syslinux_run_command(const char *command)
{
static com32sys_t ireg;
+ char *lm_command = lstrdup(command);
- strcpy(__com32.cs_bounce, command);
-
+ if (!lm_command)
+ return -1;
+
ireg.eax.w[0] = 0x0003;
- ireg.es = SEG(__com32.cs_bounce);
- ireg.ebx.w[0] = OFFS(__com32.cs_bounce);
+ ireg.es = SEG(lm_command);
+ /* ireg.ebx.w[0] = OFFS(lm_command); */
__intcall(0x22, &ireg, NULL);
- /* Should not return even on failure */
- for (;;) ;
+ /* Should not return even on failure, but in case... */
+ lfree(lm_command);
+ return -1;
}