]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_pxe.c
gpio: remove gpiolib.c and define remaining functions as static inline in asm/gpio.h
[karo-tx-uboot.git] / common / cmd_pxe.c
index 0ab1e0aaa63fa13e8b60a78ea3b7fb1a9698b293..7e32c95df3217bc575dd39be2a71fd3f6e0deea3 100644 (file)
@@ -674,6 +674,15 @@ static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
                char bootargs[CONFIG_SYS_CBSIZE] = "";
                char finalbootargs[CONFIG_SYS_CBSIZE];
 
+               if (strlen(label->append ?: "") +
+                   strlen(ip_str) + strlen(mac_str) + 1 > sizeof(bootargs)) {
+                       printf("bootarg overflow %zd+%zd+%zd+1 > %zd\n",
+                              strlen(label->append ?: ""),
+                              strlen(ip_str), strlen(mac_str),
+                              sizeof(bootargs));
+                       return 1;
+               }
+
                if (label->append)
                        strcpy(bootargs, label->append);
                strcat(bootargs, ip_str);