This is an automated email from the ASF dual-hosted git repository.
mochen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 8fcc9c351c Fix CID-1518256 (#10403)
8fcc9c351c is described below
commit 8fcc9c351cbb2768989ccfe2ea97daa0a6d6198c
Author: Mo Chen <[email protected]>
AuthorDate: Thu Sep 14 15:59:01 2023 -0500
Fix CID-1518256 (#10403)
* Fix CID-1518256
* Read the return value from read() into a dummy variable.
---
iocore/net/AsyncSignalEventIO.cc | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/iocore/net/AsyncSignalEventIO.cc b/iocore/net/AsyncSignalEventIO.cc
index f6f615456c..0a3483fb05 100644
--- a/iocore/net/AsyncSignalEventIO.cc
+++ b/iocore/net/AsyncSignalEventIO.cc
@@ -35,11 +35,14 @@ AsyncSignalEventIO::start(EventLoop l, int fd, int events)
void
AsyncSignalEventIO::process_event(int flags)
{
+ [[maybe_unused]] ssize_t ret;
#if HAVE_EVENTFD
uint64_t counter;
- static_cast<void>(read(_fd, &counter, sizeof(uint64_t)));
+ ret = read(_fd, &counter, sizeof(uint64_t));
+ ink_assert(ret >= 0);
#else
char dummy[1024];
- static_cast<void>(read(_fd, &dummy[0], 1024));
+ ret = read(_fd, &dummy[0], 1024);
+ ink_assert(ret >= 0);
#endif
}