Skip to content

Commit

Permalink
MT#55283 Fix Coverity Scan defect in call_str_cpy()
Browse files Browse the repository at this point in the history
Fixes:

*** CID 1600059:  Null pointer dereferences  (FORWARD_NULL)
/include/call.h: 919 in call_str_cpy()
913             return out;
914     }
915     INLINE str call_str_cpy_len(const char *in, size_t len) {
916             return call_str_cpy_fn(in, len, NULL);
917     }
918     INLINE str call_str_cpy(const str *in) {
>>>     CID 1600059:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dereferencing null pointer "in".
919             return call_str_cpy_fn(in ? in->s : NULL, in ? in->len : 0, in->dup);
920     }
921     INLINE str call_str_cpy_c(const char *in) {
922             return call_str_cpy_len(in, in ? strlen(in) : 0);
923     }
924     INLINE str *call_str_dup(const str *in) {

Change-Id: I975d5bd420edc3605e59e16313dce488eff46e0c
  • Loading branch information
zenichev committed Oct 3, 2024
1 parent ec500bd commit 2d08a0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ INLINE str call_str_cpy_len(const char *in, size_t len) {
return call_str_cpy_fn(in, len, NULL);
}
INLINE str call_str_cpy(const str *in) {
return call_str_cpy_fn(in ? in->s : NULL, in ? in->len : 0, in->dup);
return call_str_cpy_fn((in ? in->s : NULL), (in ? in->len : 0), (in ? in->dup : NULL));
}
INLINE str call_str_cpy_c(const char *in) {
return call_str_cpy_len(in, in ? strlen(in) : 0);
Expand Down

0 comments on commit 2d08a0a

Please sign in to comment.