Fix what I broken while amending 5b9adf81b4 76/90376/1 sandbox/zabramowska/hybrid
authorRafal Krypa <r.krypa@samsung.com>
Thu, 29 Sep 2016 14:30:59 +0000 (16:30 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 29 Sep 2016 14:30:59 +0000 (16:30 +0200)
Correct my optimizaion of SmackRules::generateAppPkgNameFromLabel().
Now it should properly locate "::App::" substring in the analyzed label.

Change-Id: I9289d1ab5bf0336bd6f42fa38ee31cfcfaba5cf5

src/common/smack-labels.cpp

index 55243a8..b007f07 100644 (file)
@@ -192,7 +192,7 @@ void generateAppPkgNameFromLabel(const std::string &label, std::string &appName,
         ThrowMsg(SmackException::InvalidLabel, "Invalid application process label " << label);
 
     size_t pkgStartPos = sizeof(pkgPrefix) - 1;
-    size_t pkgEndPos = pkgName.find(appPrefix, pkgStartPos);
+    size_t pkgEndPos = label.find(appPrefix, pkgStartPos);
     if (pkgEndPos != std::string::npos) {
         LogDebug("Hybrid application process label");
         size_t appStartPos = pkgEndPos + sizeof(appPrefix) - 1;