From beee22a95ed9044950e5486f22edd813e00ffa2c Mon Sep 17 00:00:00 2001 From: Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> Date: Thu, 14 Aug 2025 19:44:56 +0500 Subject: refactor: Use new hyprutils casts (#11377) --- src/helpers/AsyncDialogBox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/helpers/AsyncDialogBox.cpp') diff --git a/src/helpers/AsyncDialogBox.cpp b/src/helpers/AsyncDialogBox.cpp index 250b2f5a..6257dcb0 100644 --- a/src/helpers/AsyncDialogBox.cpp +++ b/src/helpers/AsyncDialogBox.cpp @@ -44,7 +44,7 @@ CAsyncDialogBox::CAsyncDialogBox(const std::string& title, const std::string& de } static int onFdWrite(int fd, uint32_t mask, void* data) { - auto box = (CAsyncDialogBox*)data; + auto box = sc(data); // lock the box to prevent a UAF auto lock = box->lockSelf(); @@ -68,7 +68,7 @@ void CAsyncDialogBox::onWrite(int fd, uint32_t mask) { } while ((ret = read(m_pipeReadFd.get(), buf.data(), 1023)) > 0) { - m_stdout += std::string_view{(char*)buf.data(), (size_t)ret}; + m_stdout += std::string_view{(buf.data()), sc(ret)}; } // restore the flags (otherwise libwayland won't give us a hangup) -- cgit v1.2.3