]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
Validate the found snapshot number
authorGergo Borus <41896618+gergo-b@users.noreply.github.com>
Tue, 20 Nov 2018 20:57:03 +0000 (21:57 +0100)
committerGergo Borus <41896618+gergo-b@users.noreply.github.com>
Tue, 20 Nov 2018 20:57:03 +0000 (21:57 +0100)
snapper/Btrfs.cc

index 153b8c69702cf73feff1426a8bea47ac216626a7..cb9f7b35800d7743e196c06bfe6dd3f3058bbb4e 100644 (file)
@@ -1463,6 +1463,9 @@ namespace snapper
 
        unsigned int num = stoi(rx.cap(1));
 
+       if (!checkSnapshot(num))
+           return make_pair(false, 0);
+
        if (get_id(openSnapshotDir(num).fd()) != id)
            return make_pair(false, 0);