Browse code

ldb: corrected offset condition check

Kevin Lin authored on 2015/06/05 06:36:10
Showing 1 changed files
... ...
@@ -1741,7 +1741,8 @@ static int load_oneldb(char *buffer, int chkpua, struct cl_engine *engine, unsig
1741 1741
         sig = tokens[3 + i];
1742 1742
 
1743 1743
         pt2 = strchr(tokens[3 + i], '/');
1744
-        if((pt = strchr(tokens[3 + i], ':')) && (pt < pt2)) {
1744
+        pt = strchr(tokens[3 + i], ':');
1745
+        if(pt && (!pt2 || (pt < pt2))) {
1745 1746
             *pt = 0;
1746 1747
             sig = ++pt;
1747 1748
             offset = tokens[3 + i];
... ...
@@ -1750,6 +1751,7 @@ static int load_oneldb(char *buffer, int chkpua, struct cl_engine *engine, unsig
1750 1750
             sig = tokens[3 + i];
1751 1751
         }
1752 1752
 
1753
+
1753 1754
         if((ret = cli_parse_add(root, virname, sig, 0, 0, 0, offset, target, lsigid, options)))
1754 1755
             return ret;
1755 1756