=== modified file 'dracut-module/password-agent.c' --- dracut-module/password-agent.c 2022-04-24 16:54:30 +0000 +++ dracut-module/password-agent.c 2023-02-07 19:18:35 +0000 @@ -1098,7 +1098,15 @@ } ievent_buffer; struct inotify_event *const ievent = &ievent_buffer.event; +#if defined(__GNUC__) and __GNUC__ >= 7 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif const ssize_t read_length = read(fd, ievent, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 7 +#pragma GCC diagnostic pop +#endif if(read_length == 0){ /* EOF */ error(0, 0, "Got EOF from inotify fd for directory %s", filename); *quit_now = true; @@ -4182,8 +4190,16 @@ memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name)); const size_t ievent_size = (sizeof(struct inotify_event) + sizeof(dummy_file_name)); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size), ==, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif g_assert_cmpint(close(pipefds[1]), ==, 0); bool quit_now = false; @@ -4277,8 +4293,16 @@ memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name)); const size_t ievent_size = (sizeof(struct inotify_event) + sizeof(dummy_file_name)); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size), ==, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif g_assert_cmpint(close(pipefds[1]), ==, 0); bool quit_now = false; @@ -4374,8 +4398,16 @@ memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name)); const size_t ievent_size = (sizeof(struct inotify_event) + sizeof(dummy_file_name)); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size), ==, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif g_assert_cmpint(close(pipefds[1]), ==, 0); bool quit_now = false; @@ -4459,8 +4491,16 @@ memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name)); const size_t ievent_size = (sizeof(struct inotify_event) + sizeof(dummy_file_name)); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size), ==, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif g_assert_cmpint(close(pipefds[1]), ==, 0); bool quit_now = false; @@ -4543,8 +4583,16 @@ memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name)); const size_t ievent_size = (sizeof(struct inotify_event) + sizeof(dummy_file_name)); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size), ==, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif g_assert_cmpint(close(pipefds[1]), ==, 0); bool quit_now = false; @@ -4619,8 +4667,16 @@ memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name)); const size_t ievent_size = (sizeof(struct inotify_event) + sizeof(dummy_file_name)); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size), ==, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif g_assert_cmpint(close(pipefds[1]), ==, 0); bool quit_now = false; @@ -4698,8 +4754,16 @@ memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name)); const size_t ievent_size = (sizeof(struct inotify_event) + sizeof(dummy_file_name)); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic push + /* ievent is pointing into a struct which is of sufficient size */ +#pragma GCC diagnostic ignored "-Wstringop-overread" +#endif g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size), ==, ievent_size); +#if defined(__GNUC__) and __GNUC__ >= 11 +#pragma GCC diagnostic pop +#endif g_assert_cmpint(close(pipefds[1]), ==, 0); bool quit_now = false;