From: Mark Michelson Date: Tue, 24 Mar 2009 22:34:45 +0000 (+0000) Subject: Change NULL pointer check to be ast_strlen_zero. X-Git-Tag: 1.4.25-rc1~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a209dbe409819b0497bad9425bf70c44f2e4a45;p=thirdparty%2Fasterisk.git Change NULL pointer check to be ast_strlen_zero. The 'digit' variable is guaranteed to be non-NULL, so the if statement could never evaluate true. Changing to ast_strlen_zero makes the logic correct. This was found while reviewing ast_channel_ao2 code review. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184078 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c index e48ba4fe06..08833fd54a 100644 --- a/apps/app_senddtmf.c +++ b/apps/app_senddtmf.c @@ -104,7 +104,7 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m) astman_send_error(s, m, "Channel not specified"); return 0; } - if (!digit) { + if (ast_strlen_zero(digit)) { astman_send_error(s, m, "No digit specified"); ast_mutex_unlock(&chan->lock); return 0;