diff options
author | Alfred E. Heggestad <aeh@db.org> | 2015-03-08 16:52:02 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2015-03-08 16:52:02 +0100 |
commit | 02799812b5d8b87630b9f7d6056c4830f6957060 (patch) | |
tree | 902684b1a1d3954000bdf38afce35b9b9dfe8702 /modules/zrtp | |
parent | 74506f1048d4782de284675bddd81c7eff0c87cb (diff) |
zrtp: initialize remote_zid
thanks to Ingo Feinerer for the patch
Diffstat (limited to 'modules/zrtp')
-rw-r--r-- | modules/zrtp/zrtp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/zrtp/zrtp.c b/modules/zrtp/zrtp.c index e5bcbf1..ef03d4c 100644 --- a/modules/zrtp/zrtp.c +++ b/modules/zrtp/zrtp.c @@ -276,7 +276,7 @@ static int verify_sas(struct re_printf *pf, void *arg) char *s2h; char rzid[ZRTP_STRING16] = ""; zrtp_status_t s; - zrtp_string16_t remote_zid; + zrtp_string16_t remote_zid = ZSTR_INIT_EMPTY(remote_zid); if (str_len(carg->prm) != 24) { warning("zrtp: invalid remote ZID (%s)\n", carg->prm); @@ -289,7 +289,8 @@ static int verify_sas(struct re_printf *pf, void *arg) warning("zrtp: str2hex failed (%s)\n", s2h); return EINVAL; } - zrtp_zstrcpyc(ZSTR_GV(remote_zid), rzid); + zrtp_zstrncpyc(ZSTR_GV(remote_zid), (const char*)rzid, + sizeof(zrtp_zid_t)); s = zrtp_cache_set_verified(zrtp_global->cache, ZSTR_GV(remote_zid), |