a memcpy -> memmove transition to prevent an abort, observed with

coccinella IAX client.

OK sthen@
This commit is contained in:
sebastia 2017-01-02 12:56:06 +00:00
parent 585d552f07
commit b89fd42f26
2 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.32 2016/04/04 16:09:10 naddy Exp $
# $OpenBSD: Makefile,v 1.33 2017/01/02 12:56:06 sebastia Exp $
COMMENT-main= IAX client library
COMMENT-tcl= IAX client library, tcl bindings
@ -6,7 +6,7 @@ COMMENT-iaxcomm=IAX softphone
DISTNAME= iaxclient-2.1beta3
PKGNAME-main= ${DISTNAME}
REVISION-main= 15
REVISION-main= 16
PKGNAME-tcl= ${DISTNAME:S/iaxclient/iaxclient-tcl/}
REVISION-tcl= 17
PKGNAME-iaxcomm= iaxcomm-1.1.0

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-lib_spandsp_plc_c,v 1.1 2017/01/02 12:56:06 sebastia Exp $
memcpy -> memmove
--- lib/spandsp/plc.c.orig Mon Jan 2 12:29:58 2017
+++ lib/spandsp/plc.c Mon Jan 2 12:33:28 2017
@@ -99,7 +99,7 @@ static void normalise_history(plc_state_t *s)
if (s->buf_ptr == 0)
return;
memcpy(tmp, s->history, sizeof(int16_t)*s->buf_ptr);
- memcpy(s->history, s->history + s->buf_ptr, sizeof(int16_t)*(PLC_HISTORY_LEN - s->buf_ptr));
+ memmove(s->history, s->history + s->buf_ptr, sizeof(int16_t)*(PLC_HISTORY_LEN - s->buf_ptr));
memcpy(s->history + PLC_HISTORY_LEN - s->buf_ptr, tmp, sizeof(int16_t)*s->buf_ptr);
s->buf_ptr = 0;
}