mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
Fixed some issues raised by coverity in spandsp ilbc and unimrcp
This commit is contained in:
@@ -142,7 +142,8 @@ MPF_DECLARE(char) mpf_dtmf_detector_digit_get(struct mpf_dtmf_detector_t *detect
|
||||
apr_thread_mutex_lock(detector->mutex);
|
||||
digit = detector->buf[0];
|
||||
if (digit) {
|
||||
strcpy(detector->buf, detector->buf + 1);
|
||||
/* This used to be a strcpy(), but that can give overlapping buffer issues */
|
||||
memmove(detector->buf, &detector->buf[1], strlen(&detector->buf[1]) + 1);
|
||||
detector->digits--;
|
||||
}
|
||||
apr_thread_mutex_unlock(detector->mutex);
|
||||
|
@@ -209,7 +209,8 @@ MPF_DECLARE(apt_bool_t) mpf_dtmf_generator_put_frame(
|
||||
/* Get next valid digit from queue */
|
||||
do {
|
||||
generator->event_id = (apr_byte_t) mpf_dtmf_char_to_event_id(*generator->queue);
|
||||
strcpy(generator->queue, generator->queue + 1);
|
||||
/* This used to be a strcpy(), but that can give overlapping buffer issues */
|
||||
memmove(generator->queue, &generator->queue[1], strlen(&generator->queue[1]) + 1);
|
||||
} while (*generator->queue && (generator->event_id > DTMF_EVENT_ID_MAX));
|
||||
/* Reset state */
|
||||
if (generator->event_id <= DTMF_EVENT_ID_MAX) {
|
||||
|
Reference in New Issue
Block a user