Mercurial > pidgin
diff libpurple/protocols/oscar/family_oservice.c @ 25557:fbcb4088d923
Make sure that the chat room name is NUL-terminated when it is truncated or
exactly 128 chars.
This came out of the veracode analysis.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Sat, 02 May 2009 19:21:11 +0000 |
parents | f6ef3a9534db |
children | c7ec8f3b39d3 |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_oservice.c Sat May 02 17:43:14 2009 +0000 +++ b/libpurple/protocols/oscar/family_oservice.c Sat May 02 19:21:11 2009 +0000 @@ -151,7 +151,8 @@ memset(&csi, 0, sizeof(csi)); csi.exchange = exchange; - strncpy(csi.name, roomname, sizeof(csi.name)); + strncpy(csi.name, roomname, sizeof(csi.name) - 1); + csi.name[sizeof(csi.name) - 1] = '\0'; csi.instance = instance; /*