Skip to content

lib1537.c : check ptr against NULL before dereferencing it #6707

Description

@kokke

I did this

Hi guys,

I am testing a homemade static analysis tool on a few code bases.
I checked out your master-branch and ran my tool and fell over this curiosity, which I think is indicative of a bug.

From tests/libtest/lib1537.c : 49-51

49  ptr = curl_escape((char *)a, asize);
50  printf("%s\n", ptr);
           ^^^^^^^^^^^  'ptr' gets dereferenced here, before the NULL-check
51  if(!ptr) {
52    res = TEST_ERR_MAJOR_BAD;
53    goto test_cleanup;
54  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions