diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-03-02 00:59:47 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-03-02 09:00:29 +0000 |
commit | e8088329ec35ad7c178695594996e6ea102ba7ea (patch) | |
tree | f359bd56d9261143129456c5933444ad8e63a4b6 /epan | |
parent | 24b5a55393bba27327998f2d608706dc73902aa9 (diff) |
One strstr() call suffices.
If we've found "interleaved=" in the buffer *and*, if so, know where
we've found it, we don't need to find it again; we can just use the
result of the first strstr() call.
That should also keep Visual Studio Code Analyzer from bogusly saying
"hey, we might not have found it, maybe we're handing a bad pointer to
sscanf()".
Change-Id: I9d8f5c0b38038a3f05b8e5343f965f1676105875
Reviewed-on: https://code.wireshark.org/review/26219
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-rtsp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c index 56cd1b1e09..0d667c0dd6 100644 --- a/epan/dissectors/packet-rtsp.c +++ b/epan/dissectors/packet-rtsp.c @@ -653,13 +653,13 @@ rtsp_create_conversation(packet_info *pinfo, proto_item *ti, } /* Deal with RTSP TCP-interleaved conversations. */ - if (strstr(buf, rtsp_inter) != NULL) { + tmp = strstr(buf, rtsp_inter); + if (tmp != NULL) { rtsp_conversation_data_t *data; guint s_data_chan, s_mon_chan; int i; - /* Move tmp to beyone interleaved string */ - tmp = strstr(buf, rtsp_inter); + /* Move tmp to beyond interleaved string */ tmp += strlen(rtsp_inter); /* Look for channel number(s) */ i = sscanf(tmp, "%u-%u", &s_data_chan, &s_mon_chan); |