]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure the buffer passed to ast_canmatch_extension() is properly initialized so
authorRussell Bryant <russell@russellbryant.com>
Mon, 15 Oct 2007 15:40:45 +0000 (15:40 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 15 Oct 2007 15:40:45 +0000 (15:40 +0000)
that it is null terminated.

(issue #10977)
Reported by: dimas
Patches:
      pbxdundi.patch uploaded by dimas (license 88)
    - small mods by me

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

pbx/pbx_dundi.c

index 21bb4e0fdb9facbcaa235ca5b0b4209d35da63b2..0b8a68175438c06020e8b4ce5e677ab67ae70776 100644 (file)
@@ -578,8 +578,8 @@ static int dundi_lookup_local(struct dundi_result *dr, struct dundi_mapping *map
                } else {
                        /* No answers...  Find the fewest number of digits from the
                           number for which we have no answer. */
-                       char tmp[AST_MAX_EXTENSION];
-                       for (x=0;x<AST_MAX_EXTENSION;x++) {
+                       char tmp[AST_MAX_EXTENSION + 1] = "";
+                       for (x = 0; x < (sizeof(tmp) - 1); x++) {
                                tmp[x] = called_number[x];
                                if (!tmp[x])
                                        break;