aboutsummaryrefslogtreecommitdiffstats
path: root/packet-icq.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-10-25 20:32:52 +0000
committerGuy Harris <guy@alum.mit.edu>1999-10-25 20:32:52 +0000
commitd3ab2c76af401cc6ab26a8de774f23e3ca437aac (patch)
treeca524a8c1794abc8348582acab5eb1bba0e9546a /packet-icq.c
parenta54314e9617b253f4356876792fa1b510acc300e (diff)
Ensure that "password" is '\0'-terminated.
svn path=/trunk/; revision=925
Diffstat (limited to 'packet-icq.c')
-rw-r--r--packet-icq.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/packet-icq.c b/packet-icq.c
index f92869cddf..cd3716227f 100644
--- a/packet-icq.c
+++ b/packet-icq.c
@@ -1,7 +1,7 @@
/* packet-icq.c
* Routines for ICQ packet disassembly
*
- * $Id: packet-icq.c,v 1.2 1999/10/25 20:28:21 guy Exp $
+ * $Id: packet-icq.c,v 1.3 1999/10/25 20:32:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Johan Feyaerts
@@ -707,8 +707,9 @@ icqv5_cmd_login(proto_tree* tree,
passwdLen = pletohs(pd + CMD_LOGIN_PASSLEN);
}
if (left>=10+passwdLen) {
- password = g_malloc(passwdLen);
+ password = g_malloc(passwdLen + 1);
strncpy(password, pd + CMD_LOGIN_PASSWD, passwdLen);
+ password[passwdLen] = '\0';
}
if (left>=10+passwdLen+CMD_LOGIN_IP+4) {