summaryrefslogtreecommitdiff
path: root/cmd/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/elf.c')
-rw-r--r--cmd/elf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd/elf.c b/cmd/elf.c
index 6b49c613703..53ec193aaa6 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -21,6 +21,8 @@
#include <linux/linkage.h>
#endif
+#define BOOTLINE_BUF_LEN 128
+
/* Interpreter command to boot an arbitrary ELF image from memory */
int do_bootelf(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
@@ -114,7 +116,7 @@ int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
unsigned long bootaddr = 0; /* Address to put the bootline */
char *bootline; /* Text of the bootline */
char *tmp; /* Temporary char pointer */
- char build_buf[128]; /* Buffer for building the bootline */
+ char build_buf[BOOTLINE_BUF_LEN]; /* Buffer for building the bootline */
int ptr = 0;
#ifdef CONFIG_X86
ulong base;
@@ -226,7 +228,7 @@ int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
if (!bootline) {
tmp = env_get("bootdev");
if (tmp) {
- strcpy(build_buf, tmp);
+ strlcpy(build_buf, tmp, BOOTLINE_BUF_LEN);
ptr = strlen(tmp);
} else {
printf("## VxWorks boot device not specified\n");
@@ -247,7 +249,7 @@ int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
ptr += sprintf(build_buf + ptr, "e=%s", tmp);
tmp = env_get("netmask");
if (tmp) {
- u32 mask = env_get_ip("netmask").s_addr;
+ u32 mask = string_to_ip(tmp).s_addr;
ptr += sprintf(build_buf + ptr,
":%08x ", ntohl(mask));
} else {