]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Avoid a crash if we don't pass an argument to 'astobj2 test.'
authorSean Bright <sean@malleable.com>
Tue, 7 Dec 2010 15:23:18 +0000 (15:23 +0000)
committerSean Bright <sean@malleable.com>
Tue, 7 Dec 2010 15:23:18 +0000 (15:23 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297775 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/astobj2.c

index b88732ea25dc7f20daeb3c849cdc23f845d64029..12da832d6482654d9ca9025ce2ea9b09a19f04f5 100644 (file)
@@ -758,6 +758,10 @@ static int handle_astobj2_test(int fd, int argc, char *argv[])
        char *obj;
        static int prof_id = -1;
 
+       if (argc != 3) {
+               return RESULT_SHOWUSAGE;
+       }
+
        if (prof_id == -1)
                prof_id = ast_add_profile("ao2_alloc", 0);