no non-null pointer judgment after malloc

Bug #1836530 reported by zhangqing on 2019-07-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Low
zhangqing

Bug Description

Title
-----

Non-null pointer judgment is required after malloc.

Brief Description
-----------------
file :hwmonHttp.cpp
function: hwmonHttp_server_handler()

    char * buffer_ptr = (char*)malloc(len+1);
    memset ( buffer_ptr, 0, len+1 );

if failing to allocate memory and then operating the null pointer will cause undescribable consequence.

Severity
--------
Provide the severity of the defect.
<Minor>

Change abandoned by zhangqing (zqhsh527@163.com) on branch: master
Review: https://review.opendev.org/670779

Change abandoned by zhangqing (zqhsh527@163.com) on branch: master
Review: https://review.opendev.org/670788

Ghada Khalil (gkhalil) wrote :

Low priority / not gating - code cleanup with no noted functional impact.

tags: added: stx.metal
Changed in starlingx:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → zhangqing (zhangqing)
Ghada Khalil (gkhalil) wrote :

Moving forward, please use the starlingx bug template.

zhangqing (qingzhang) on 2019-07-16
description: updated

Change abandoned by zhangqing (zqhsh527@163.com) on branch: master
Review: https://review.opendev.org/670794

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers