aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-17 22:08:01 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-17 22:08:01 +0000
commitbc7512ec84522179543a47b8f5c9fb11f4308347 (patch)
treee06fa12c468b9293b0db353faec861b993854c0a /main
parentf9ef3114dc38eef3ffecabc7f36d451e785460e7 (diff)
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/trunk@263640 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/devicestate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/devicestate.c b/main/devicestate.c
index 49e24d8ab..3fee8fe1e 100644
--- a/main/devicestate.c
+++ b/main/devicestate.c
@@ -323,8 +323,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;