From f332888366919c2445295bf4ef4795a0d8c073f0 Mon Sep 17 00:00:00 2001 From: Satyanvesh Dittakavi <53337087+satyanveshd@users.noreply.github.com> Date: Sat, 1 Nov 2025 00:04:44 +0530 Subject: [PATCH] SWDEV-560304 - Fix segfault with invalid stream (#1360) --- projects/clr/hipamd/src/hip_stream.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/clr/hipamd/src/hip_stream.cpp b/projects/clr/hipamd/src/hip_stream.cpp index ff3d68388f..3c4b5e8429 100644 --- a/projects/clr/hipamd/src/hip_stream.cpp +++ b/projects/clr/hipamd/src/hip_stream.cpp @@ -936,6 +936,10 @@ hipError_t hipStreamGetAttribute(hipStream_t stream, hipStreamAttrID attr, hipError_t hipStreamCopyAttributes(hipStream_t dst, hipStream_t src) { HIP_INIT_API(hipStreamCopyAttributes, dst, src); + if (!hip::isValid(src) || !hip::isValid(dst)) { + HIP_RETURN(hipErrorInvalidResourceHandle); + } + getStreamPerThread(src); getStreamPerThread(dst);