Browse Source

MT#60476 sdp_version_replace: don't check src_orig ptr

Already checked before in sdp_version_check.

Fixes defect:

/daemon/sdp.c: 2936 in sdp_version_replace()
2930                            /* update string unconditionally to keep position tracking intact */
2931                            chopper_replace(chop, &origin->version_str, &origin->version_output_pos, version_str, version_len);
2932                    }
2933            }
2934            /* for sdp_create */
2935            else {
>>>     CID 1598877:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "src_orig" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2936                    if (!other_orig || !src_orig)
2937                            return;
2938
2939                    other_orig->version_num = src_orig->version_num;
2940                    /* is our new value longer? */
2941                    if (version_len > other_orig->version_str.len) {

Change-Id: I068a13ccc454fd61600546d05c78bde979203fc7
pull/1848/head
Donat Zenichev 1 year ago
parent
commit
808c3e7f20
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      daemon/sdp.c

+ 1
- 1
daemon/sdp.c View File

@ -2933,7 +2933,7 @@ static void sdp_version_replace(struct sdp_chopper *chop, GString *s,
}
/* for sdp_create */
else {
if (!other_orig || !src_orig)
if (!other_orig)
return;
other_orig->version_num = src_orig->version_num;


Loading…
Cancel
Save