mirror of https://github.com/OpenVPN/openvpn-gui
Fix two off-by-one memory assignments
These bugs were found with ZeroPath. Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>pull/770/head
parent
23e18c9132
commit
c88b7c66c6
|
|
@ -966,7 +966,7 @@ GenericPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
/* send username */
|
||||
template = "username \"Auth\" \"%s\"";
|
||||
char *username = escape_string(param->user);
|
||||
fmt = malloc(strlen(template) + strlen(username));
|
||||
fmt = malloc(strlen(template) + strlen(username) + 1);
|
||||
|
||||
if (fmt && username)
|
||||
{
|
||||
|
|
@ -2188,7 +2188,7 @@ OnNeedOk(connection_t *c, char *msg)
|
|||
}
|
||||
|
||||
/* allocate space for response : "needok param->id cancel/ok" */
|
||||
resp = malloc(strlen(param->id) + strlen("needok \' \' cancel"));
|
||||
resp = malloc(strlen(param->id) + strlen("needok \' \' cancel") + 1);
|
||||
wstr = Widen(param->str);
|
||||
|
||||
if (!wstr || !resp)
|
||||
|
|
|
|||
Loading…
Reference in New Issue