From 80e6ba61729e2ab4566387f829c46886e71b0d95 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Fri, 8 Feb 2002 21:28:21 +0000 Subject: [PATCH] Fix for menu 5.1.14 buffer overflow --- ChangeLog | 4 ++++ mbsetup/ledit.c | 4 ++-- mbsetup/m_modem.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07a2e4a1..85710866 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4338,6 +4338,10 @@ v0.33.19 26-Oct-2001 When editing a node's connected file/mail groups it can now handle more then 40 groups without messing up the screen. Fixed area selection in filedatabase editor. + Protected help string display for boolean edit against buffer + overflow. + Menu 5.1.14, helpstring was too long, causing a buffer + overflow without the previous protection. mbsebbs: Added menu 317, change FS editor shortcut keys to (Emacs/ diff --git a/mbsetup/ledit.c b/mbsetup/ledit.c index ad03af2f..7259c218 100644 --- a/mbsetup/ledit.c +++ b/mbsetup/ledit.c @@ -671,8 +671,8 @@ int edit_bool(int y, int x, int val, char *help) int ch; char *temp; - temp = calloc(81, sizeof(char)); - sprintf(temp, "%s (Spacebar = toggle)", help); + temp = xstrcpy(help); + temp = xstrcat(temp, (char *)" (Spacebar = toggle)"); showhelp(temp); free(temp); diff --git a/mbsetup/m_modem.c b/mbsetup/m_modem.c index 7c7d1af2..479ee208 100644 --- a/mbsetup/m_modem.c +++ b/mbsetup/m_modem.c @@ -483,7 +483,7 @@ int EditModemRec(int Area) case 11:E_STR(17,14,15, modem.speed, "The ^EMSI speed^ message for this modem") case 12:E_BOOL(15,44, modem.available, "If this modem is ^available^") case 13:E_BOOL(16,44, modem.deleted, "If this modem is to be ^deleted^ from the setup") - case 14:E_BOOL(17,44, modem.stripdash, "Stript ^dashes (-)^ from dial command strings if this modem needs it") + case 14:E_BOOL(17,44, modem.stripdash, "Strip ^dashes (-)^ from dial command strings if needed") case 15: EditConnect(); Modem_Screen();