From 322471cdd766d8bddc219c2e367083d84d4e5785 Mon Sep 17 00:00:00 2001 From: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com> Date: Fri, 30 Jan 2026 00:01:33 -0800 Subject: [PATCH] [https://nvbugs/5825514][fix] Add null pointer check to parseNpyHeader (#10944) Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com> This PR addresses known security issues. For the latest NVIDIA Vulnerability Disclosure Information visit https://www.nvidia.com/en-us/security/, for acknowledgement please reach out to the NVIDIA PSIRT team at PSIRT@nvidia.com --- cpp/tensorrt_llm/runtime/utils/numpyUtils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/tensorrt_llm/runtime/utils/numpyUtils.cpp b/cpp/tensorrt_llm/runtime/utils/numpyUtils.cpp index 4c37f480bd..6f95704455 100644 --- a/cpp/tensorrt_llm/runtime/utils/numpyUtils.cpp +++ b/cpp/tensorrt_llm/runtime/utils/numpyUtils.cpp @@ -105,6 +105,7 @@ void parseNpyIntro(FILE*& f_ptr, uint32_t& header_len, uint32_t& start_data) int parseNpyHeader(FILE*& f_ptr, uint32_t header_len, nvinfer1::DataType& type, std::vector& shapeVec) { char* header_c = (char*) malloc(header_len * sizeof(char)); + TLLM_CHECK_WITH_INFO(header_c != nullptr, "Failed to allocate memory for npy header"); size_t n_elems = fread((void*) header_c, sizeof(char), header_len, f_ptr); if (n_elems != header_len) {