mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtsession: Coverity (memory corruption)
This commit is contained in:
parent
b41a74b595
commit
07dc336b96
1 changed files with 5 additions and 5 deletions
|
@ -170,7 +170,7 @@ static Boolean saveTimeout;
|
|||
Widget
|
||||
CreateLockDialog( void )
|
||||
{
|
||||
int i;
|
||||
int i, slen;
|
||||
Widget loginLabel, instructLabel, tmpLock, indFrame;
|
||||
Widget passwdLabel, passwdForm, picFrame, loginPic, loginFrame;
|
||||
Dimension width; /* width, height of login label */
|
||||
|
@ -279,10 +279,10 @@ CreateLockDialog( void )
|
|||
*/
|
||||
i = 0;
|
||||
envLog = getenv("LOGNAME");
|
||||
lockMessage = XtMalloc(100 + strlen(envLog));
|
||||
sprintf(
|
||||
lockMessage,
|
||||
(char*) GETMESSAGE(18, 1, "Display locked by user %s."), envLog);
|
||||
slen = 100 + strlen(envLog) + 1;
|
||||
lockMessage = XtCalloc(1, slen);
|
||||
snprintf(lockMessage, slen - 1,
|
||||
(char*) GETMESSAGE(18, 1, "Display locked by user %s."), envLog);
|
||||
lockString = XmStringCreateLocalized(lockMessage);
|
||||
XtSetArg(uiArgs[i], XmNtopAttachment, XmATTACH_POSITION); i++;
|
||||
XtSetArg(uiArgs[i], XmNtopPosition, 20); i++;
|
||||
|
|
Loading…
Reference in a new issue