Browse Source

MT#55283 Fix Coverity Scan defect in `call_str_cpy()`

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
pull/1870/head
Donat Zenichev 1 year ago
parent
commit
2d08a0afa1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      include/call.h

+ 1
- 1
include/call.h View File

@ -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);


Loading…
Cancel
Save