diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-30 17:55:28 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-30 17:55:28 +0000 |
commit | 6de71be154abf1d2f776714afa5bada0aa04edaf (patch) | |
tree | 130124c1a9f505e8110a6e27531ecfdd4bc6fef5 | |
parent | d9a6c2e758e862fc5ae3971a9595c952b5404cef (diff) |
Do not exceed the array size for maximum allowed moh files. (issue #6842)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@16534 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | res/res_musiconhold.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 2a27dcec8..97ae3d871 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -778,6 +778,11 @@ static int moh_scan_files(struct mohclass *class) { if (i == class->total_files) strcpy(class->filearray[class->total_files++], filepath); + + /* If the new total files is equal to the maximum allowed, stop adding new ones */ + if (class->total_files == MAX_MOHFILES) + break; + } closedir(files_DIR); |