From: Lennart Poettering Date: Fri, 14 Apr 2023 11:08:03 +0000 (+0200) Subject: mountpoint-util: use memcmp_nn() where appropriate X-Git-Tag: v254-rc1~716^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F27269%2Fhead;p=thirdparty%2Fsystemd.git mountpoint-util: use memcmp_nn() where appropriate --- diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c index 601776541b7..484f1e17507 100644 --- a/src/basic/mountpoint-util.c +++ b/src/basic/mountpoint-util.c @@ -271,9 +271,9 @@ int fd_is_mount_point(int fd, const char *filename, int flags) { /* If the file handle for the directory we are interested in and its parent are identical, * we assume this is the root directory, which is a mount point. */ - if (h->handle_bytes == h_parent->handle_bytes && - h->handle_type == h_parent->handle_type && - memcmp(h->f_handle, h_parent->f_handle, h->handle_bytes) == 0) + if (h->handle_type == h_parent->handle_type && + memcmp_nn(h->f_handle, h->handle_bytes, + h_parent->f_handle, h_parent->handle_bytes) == 0) return 1; return mount_id != mount_id_parent;