aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2011-04-15 21:26:52 +0200
committerErwan Velu <erwanaliasr1@gmail.com>2011-04-15 21:26:52 +0200
commitba305c222256dcec6d94b3fb803e15d6ef83cc3e (patch)
tree2279c13f94ea652bdf1f1f323f4996340518b645 /com32/hdt
parent629199e1eaa19e21a6da0769c163dd131aa80163 (diff)
downloadsyslinux-ba305c222256dcec6d94b3fb803e15d6ef83cc3e.tar.gz
syslinux-ba305c222256dcec6d94b3fb803e15d6ef83cc3e.tar.xz
syslinux-ba305c222256dcec6d94b3fb803e15d6ef83cc3e.zip
hdt: Fixing buffer corruption in PXE menu
Jim Cromie reported that PXE menu behave like : gPXE Detected: ]No This commit avoid this buffer corruption.
Diffstat (limited to 'com32/hdt')
-rw-r--r--com32/hdt/hdt-menu-pxe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/com32/hdt/hdt-menu-pxe.c b/com32/hdt/hdt-menu-pxe.c
index 426bfe07..12d8b116 100644
--- a/com32/hdt/hdt-menu-pxe.c
+++ b/com32/hdt/hdt-menu-pxe.c
@@ -34,7 +34,7 @@ void compute_PXE(struct s_my_menu *menu, struct s_hardware *hardware)
{
char buffer[SUBMENULEN + 1];
char infobar[STATLEN + 1];
- char gpxe[4];
+ char gpxe[4]={0};
if (hardware->is_pxe_valid == false)
return;
@@ -113,8 +113,8 @@ void compute_PXE(struct s_my_menu *menu, struct s_hardware *hardware)
add_item(buffer, infobar, OPT_INACTIVE, NULL, 0);
menu->items_count++;
- if (is_gpxe()) strcat(gpxe,"Yes");
- else strcat (gpxe,"No");
+ if (is_gpxe()) snprintf(gpxe,sizeof(gpxe),"%s","Yes");
+ else snprintf (gpxe, sizeof(gpxe), "%s", "No");
snprintf(buffer, sizeof buffer, "gPXE Detected: %s", gpxe);
snprintf(infobar, sizeof infobar, "gPXE Detected: %s", gpxe);