mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-02-04 18:21:52 +08:00
[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
This commit is contained in:
parent
4f0c1b2489
commit
322471cdd7
@ -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<size_t>& 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)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user