summaryrefslogtreecommitdiffstats
path: root/src/windows/cns/cns.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2000-07-01 01:14:04 +0000
committerKen Raeburn <raeburn@mit.edu>2000-07-01 01:14:04 +0000
commit723cb92bb9dfb9c8b52dd6e9c4296bddf14cbaad (patch)
tree465b4fe51a5e3705258e64255635d78d96dd6be6 /src/windows/cns/cns.c
parent35414838ecf54b3598f2711d79b2feaf2e75ed2b (diff)
downloadkrb5-723cb92bb9dfb9c8b52dd6e9c4296bddf14cbaad.tar.gz
krb5-723cb92bb9dfb9c8b52dd6e9c4296bddf14cbaad.tar.xz
krb5-723cb92bb9dfb9c8b52dd6e9c4296bddf14cbaad.zip
pullup from 1.2-beta4
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12499 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/cns/cns.c')
-rw-r--r--src/windows/cns/cns.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/windows/cns/cns.c b/src/windows/cns/cns.c
index 7af81fc6ad..512f2f5c36 100644
--- a/src/windows/cns/cns.c
+++ b/src/windows/cns/cns.c
@@ -384,12 +384,13 @@ kwin_push_login(HWND hwnd, char *name, char *instance, char *realm)
char menuitem[MAX_K_NAME_SZ + 3];
BOOL rc;
- strcpy(fullname, "&x ");
- strcat(fullname, name);
- strcat(fullname, ".");
- strcat(fullname, instance);
- strcat(fullname, "@");
- strcat(fullname, realm);
+ fullname[sizeof(fullname) - 1] = '\0';
+ strncpy(fullname, "&x ", sizeof(fullname) - 1);
+ strncat(fullname, name, sizeof(fullname) - 1 - strlen(fullname));
+ strncat(fullname, ".", sizeof(fullname) - 1 - strlen(fullname));
+ strncat(fullname, instance, sizeof(fullname) - 1 - strlen(fullname));
+ strncat(fullname, "@", sizeof(fullname) - 1 - strlen(fullname));
+ strncat(fullname, realm, sizeof(fullname) - 1 - strlen(fullname));
hmenu = GetMenu(hwnd);
assert(hmenu != NULL);
@@ -1339,14 +1340,16 @@ kwin_command(HWND hwnd, int cid, HWND hwndCtl, UINT codeNotify)
strcpy(copyright, " Kerberos V5 for Windows ");
#endif
#ifdef _WIN32
- strcat(copyright, "32-bit\n");
+ strncat(copyright, "32-bit\n", sizeof(copyright) - 1 - strlen(copyright));
#else
- strcat(copyright, "16-bit\n");
+ strncat(copyright, "16-bit\n", sizeof(copyright) - 1 - strlen(copyright));
#endif
- strcat(copyright, "\n Version 1.12\n\n");
+ strncat(copyright, "\n Version 1.12\n\n",
+ sizeof(copyright) - 1 - strlen(copyright));
#ifdef ORGANIZATION
- strcat(copyright, " For information, contact:\n");
- strcat(copyright, ORGANIZATION);
+ strncat(copyright, " For information, contact:\n",
+ sizeof(copyright) - 1 - strlen(copyright));
+ strncat(copyright, ORGANIZATION, sizeof(copyright) - 1 - strlen(copyright));
#endif
MessageBox(hwnd, copyright, KWIN_DIALOG_NAME, MB_OK);
@@ -1469,8 +1472,9 @@ kwin_paint(HWND hwnd)
sprintf(buf, "%s - %ld hr", KWIN_DIALOG_NAME, dt);
}
+ buf[sizeof(buf) - 1] = '\0';
if (dt > 1)
- strcat(buf, "s");
+ strncat(buf, "s", sizeof(buf) - 1 - strlen(buf));
}
DrawIcon(hdc, r.left, r.top, hicon);