]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
elf-util: add missing assertion
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Jan 2022 17:02:12 +0000 (02:02 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Jan 2022 19:27:11 +0000 (04:27 +0900)
src/shared/elf-util.c

index 32335f9cdb7ae48b54015b543863e261799e4dad..8cb4a9929880c1f6b909d003e717212a8a8f7af3 100644 (file)
@@ -689,6 +689,8 @@ int parse_elf_object(int fd, const char *executable, bool fork_disable_dump, cha
         _cleanup_free_ char *buf = NULL;
         int r;
 
+        assert(fd >= 0);
+
         r = dlopen_dw();
         if (r < 0)
                 return r;