aboutsummaryrefslogtreecommitdiffstats
path: root/main/devicestate.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-17 22:10:46 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-17 22:10:46 +0000
commit1682e083376ac3164d46c9a8e7e39e2051f72865 (patch)
treeaa6aff58f4898c7578e5192511a2edb655db0d42 /main/devicestate.c
parentf7d1db3fcb4bd10f09654729b4ad2cf86c924e2a (diff)
Merged revisions 263640 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r263640 | mmichelson | 2010-05-17 17:08:01 -0500 (Mon, 17 May 2010) | 16 lines Merged revisions 263639 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r263639 | mmichelson | 2010-05-17 17:00:28 -0500 (Mon, 17 May 2010) | 10 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.2@263642 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/devicestate.c')
-rw-r--r--main/devicestate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/devicestate.c b/main/devicestate.c
index 83cbbb7b4..49b7e1efc 100644
--- a/main/devicestate.c
+++ b/main/devicestate.c
@@ -327,8 +327,10 @@ static enum ast_device_state _ast_device_state(const char *device, int check_cac
buf = ast_strdupa(device);
tech = strsep(&buf, "/");
if (!(number = buf)) {
- if (!(provider = strsep(&tech, ":")))
+ provider = strsep(&tech, ":");
+ if (!tech) {
return AST_DEVICE_INVALID;
+ }
/* We have a provider */
number = tech;
tech = NULL;