From: <arc...@us...> - 2013-02-15 00:44:34
|
Revision: 637 http://sourceforge.net/p/sipp/code/637 Author: arcady-91 Date: 2013-02-15 00:44:31 +0000 (Fri, 15 Feb 2013) Log Message: ----------- Fixing overlapping values in sprintf Modified Paths: -------------- sipp/trunk/auth.c sipp/trunk/call.cpp Modified: sipp/trunk/auth.c =================================================================== --- sipp/trunk/auth.c 2013-02-15 00:44:25 UTC (rev 636) +++ sipp/trunk/auth.c 2013-02-15 00:44:31 UTC (rev 637) @@ -631,7 +631,8 @@ } auts_hex[AUTS64LEN-1]=0; - sprintf(result, "%s,auts=\"%s\"",result,auts_hex); + sprintf(tmp, "%s,auts=\"%s\"",result,auts_hex); + strcat(result,tmp); } free(nonce); return 1; Modified: sipp/trunk/call.cpp =================================================================== --- sipp/trunk/call.cpp 2013-02-15 00:44:25 UTC (rev 636) +++ sipp/trunk/call.cpp 2013-02-15 00:44:31 UTC (rev 637) @@ -691,18 +691,23 @@ /* Dump call info to error log. */ void call::dump() { char s[MAX_HEADER_LEN]; + char tmpbuf[MAX_HEADER_LEN]; sprintf(s, "%s: State %d", id, msg_index); if (next_retrans) { - sprintf(s, "%s (next retrans %u)", s, next_retrans); + snprintf(tmpbuf, 64, "%s (next retrans %u)", s, next_retrans); + strcat(s, tmpbuf); } if (paused_until) { - sprintf(s, "%s (paused until %u)", s, paused_until); + snprintf(tmpbuf, 64, "%s (paused until %u)", s, paused_until); + strcat(s, tmpbuf); } if (recv_timeout) { - sprintf(s, "%s (recv timeout %u)", s, recv_timeout); + snprintf(tmpbuf, 64, "%s (recv timeout %u)", s, recv_timeout); + strcat(s, tmpbuf); } if (send_timeout) { - sprintf(s, "%s (send timeout %u)", s, send_timeout); + snprintf(tmpbuf, 64, "%s (send timeout %u)", s, send_timeout); + strcat(s, tmpbuf); } WARNING("%s", s); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |