]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #11594)
authorJeff Peeler <jpeeler@digium.com>
Tue, 3 Jun 2008 22:15:33 +0000 (22:15 +0000)
committerJeff Peeler <jpeeler@digium.com>
Tue, 3 Jun 2008 22:15:33 +0000 (22:15 +0000)
Reported by: yem
Tested by: yem

This change decreases the buffer size allocated on the stack substantially in config_text_file_load when LOW_MEMORY is turned on. This change combined with the fix from revision 117462 (making mkintf not copy the zt_chan_conf structure) was enough to prevent the crash.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120173 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/config.c

index 00cc0d836729a4300d3cfa5332ca5ef10ae05e5e..84ef8ad4e1aa9a8f708e8e53c805378b8ee1f5b0 100644 (file)
@@ -812,7 +812,11 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
 static struct ast_config *config_text_file_load(const char *database, const char *table, const char *filename, struct ast_config *cfg, int withcomments)
 {
        char fn[256];
+#if defined(LOW_MEMORY)
+       char buf[512];
+#else
        char buf[8192];
+#endif
        char *new_buf, *comment_p, *process_buf;
        FILE *f;
        int lineno=0;