]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
namespace-util: add missing half of the assertion in is_our_namespace()
authorMike Yuan <me@yhndnzj.com>
Tue, 17 Feb 2026 08:26:20 +0000 (09:26 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Sat, 13 Jun 2026 15:11:10 +0000 (17:11 +0200)
src/basic/namespace-util.c

index fff518ef96957efe88def641732a1daf63fe8b11..97ed3d268fcb9f176f4974e9f61d2fde286aa3e3 100644 (file)
@@ -359,7 +359,7 @@ int is_our_namespace(int fd, NamespaceType type) {
         int r;
 
         assert(fd >= 0);
-        assert(type < _NAMESPACE_TYPE_MAX);
+        assert(type >= 0 && type < _NAMESPACE_TYPE_MAX);
 
         r = fd_is_namespace(fd, type);
         if (r < 0)