aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-05-07 20:04:47 -0300
committerdequis <dx@dxzone.com.ar>2015-05-07 20:12:06 -0300
commit5535a47f4c2b9def68356d1ced9a149a7197f32c (patch)
tree9c05160494a67119c0f3c27ad42a4606694fa4c0 /irc_im.c
parent81a15dab997b9dc3f94d46ebee331cf61fc2e43d (diff)
More coverity fixes!
CID 18634: 'Logically dead code' in jabber_get_info CID 18638: 'Dereference after null check' in oauth2_access_token_done CID 18691: 'Copy into fixed size buffer' in bee_irc_user_new CID 20274: Leak in bee_irc_chat_invite CID 20297, CID 20283: Leaks in crypt_main Some the base64 leaks there weren't detected, needs modeling.
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/irc_im.c b/irc_im.c
index 58cf2667..ae75fad1 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -49,7 +49,7 @@ static gboolean bee_irc_user_new(bee_t *bee, bee_user_t *bu)
char nick[MAX_NICK_LENGTH + 1], *s;
memset(nick, 0, MAX_NICK_LENGTH + 1);
- strcpy(nick, nick_get(bu));
+ strncpy(nick, nick_get(bu), MAX_NICK_LENGTH);
bu->ui_data = iu = irc_user_new(irc, nick);
iu->bu = bu;
@@ -722,6 +722,8 @@ static gboolean bee_irc_chat_invite(bee_t *bee, bee_user_t *bu, const char *name
if (irc_channel_by_name(irc, s) == NULL) {
g_free(channel);
channel = s;
+ } else {
+ g_free(s);
}
}