Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7050
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25562
dc483132-0cff-0310-8789-
dd5450dbe970
{
char message[2048];
char *p = message;
- int size = sizeof(message);
+ int size = sizeof(message) - 1; /* -1 to leave room for NULL terminator */
int n;
// XXX: ignore AFS for now.
n = _snprintf(p, size,
"Kerberos 5: %s (error %ld)\n",
perror_message(rc5),
- rc5 & 255 // XXX: & 255??!!!
+ rc5
);
p += n;
size -= n;
size -= n;
}
#ifdef USE_MESSAGE_BOX
+ *p = 0; /* ensure NULL termination of message */
if ( displayMB )
MessageBox(NULL, message, "Leash", MB_OK | MB_ICONERROR | MB_TASKMODAL |
MB_SETFOREGROUND);