summaryrefslogtreecommitdiff
path: root/main/say.c
diff options
context:
space:
mode:
authorAlexei Gradinari <alex2grad@gmail.com>2016-06-16 16:56:19 -0400
committerAlexei Gradinari <alex2grad@gmail.com>2016-06-20 13:06:00 -0400
commit5134a8043a81b5b3d0b70ae3fbf7564f2526469a (patch)
tree23b8a01a91b6e148f00187b1b624e66ea5753b6e /main/say.c
parent03953d80346b3561305606f8509ab3ea2fa962a1 (diff)
fix: memory leaks, resource leaks, out of bounds and bugs
ASTERISK-26119 #close Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c
Diffstat (limited to 'main/say.c')
-rw-r--r--main/say.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/say.c b/main/say.c
index ef80dfa7d..51dc4e23a 100644
--- a/main/say.c
+++ b/main/say.c
@@ -7948,9 +7948,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;