From 820ed3d4b35d5a906863375f0336e881530fa99c Mon Sep 17 00:00:00 2001 From: Alexei Gradinari Date: Fri, 17 Jun 2016 14:51:57 -0400 Subject: fix: memory leaks, resource leaks, out of bounds and bugs ASTERISK-26119 #close Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c --- main/say.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main/say.c') diff --git a/main/say.c b/main/say.c index 6e51de201..e4e374329 100644 --- a/main/say.c +++ b/main/say.c @@ -8521,9 +8521,9 @@ int ast_say_date_with_format_ja(struct ast_channel *chan, time_t time, const cha /* NOTE: if you add more options here, please try to be consistent with strftime(3) */ case '\'': /* Literal name of a sound file */ - sndoffset=0; - for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++) + for (sndoffset = 0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++) { sndfile[sndoffset] = format[offset]; + } sndfile[sndoffset] = '\0'; res = wait_file(chan,ints,sndfile,lang); break; -- cgit v1.2.3