Skip to content

Commit 706136c

Browse files
committed
Args.c: add missing length check
Will currently not trigger because the length of the md5 is way shorter than nxagentDialogName, but it will become a problem if those sizes ever change, e.g. a new hash function is used.
1 parent e4c245b commit 706136c

File tree

1 file changed

+2
-1
lines changed
  • nx-X11/programs/Xserver/hw/nxagent

1 file changed

+2
-1
lines changed

nx-X11/programs/Xserver/hw/nxagent/Args.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,8 @@ static int nxagentGetDialogName()
20052005

20062006
if (length > 0 && nxagentSessionId[length] == '-')
20072007
{
2008-
strncat(nxagentDialogName, nxagentSessionId, length));
2008+
strncat(nxagentDialogName, nxagentSessionId,
2009+
MIN(length, sizeof(nxagentDialogName) - 1 - strlen(prefix)));
20092010
}
20102011
else
20112012
{

0 commit comments

Comments
 (0)