From: Sean Bright Date: Tue, 7 Dec 2010 15:23:18 +0000 (+0000) Subject: Avoid a crash if we don't pass an argument to 'astobj2 test.' X-Git-Tag: 1.4.39-rc1~3^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0135ff19edd53c46c435f9de9eab57f42eba4a4a;p=thirdparty%2Fasterisk.git Avoid a crash if we don't pass an argument to 'astobj2 test.' git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297775 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/astobj2.c b/main/astobj2.c index b88732ea25..12da832d64 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -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);