From: Mark Michelson Date: Mon, 17 May 2010 22:00:28 +0000 (+0000) Subject: Fix logic error when checking for a devstate provider. X-Git-Tag: 1.4.33-rc1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=760f0a8a8b879180bb82e2232e5f292d74f439cd;p=thirdparty%2Fasterisk.git Fix logic error when checking for a devstate provider. When using strsep, if one of the list of specified separators is not found, it is the first parameter to strsep which is now NULL, not the pointer returned by strsep. This issue isn't especially severe in that the worst it is likely to do is waste some cycles when a device with no '/' and no ':' is passed to ast_device_state. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@263639 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/devicestate.c b/main/devicestate.c index e1a52dd636..c8a7dc69c9 100644 --- a/main/devicestate.c +++ b/main/devicestate.c @@ -145,7 +145,7 @@ int ast_device_state(const char *device) number = buf; if (!number) { provider = strsep(&tech, ":"); - if (!provider) + if (!tech) return AST_DEVICE_INVALID; /* We have a provider */ number = tech;