Skip to content

Commit e5ce29b

Browse files
Add missing NULL check when analyzing AssuredCtrl messages with no parameters (#44)
* SMF plugin crashes when there are no parameters in an assured control message. Check for a null pointer return from p_get_proto_data in smf_analysis_assuredctrl * Correct comment in README regarding where to install plugin. %APPDATA% now includes 'Roaming' in the variable already. Also try using '-1' as a plugin-version on windows developer loads. * Update the Windows and Global Plugin Folder doc to be more clear. * Remove 'Roaming' frmo workflow docs as that is already in %APPDATA%
1 parent 259e8a4 commit e5ce29b

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.github/workflows/build_plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
PATCH_VERSION: ${{ inputs.PATCH_VERSION || '0' }}
4747
# this goes into FILEVERSION which appears when you hover over the DLL, but cannot
4848
# contain a string like "dev"
49-
SMF_PLUGIN_PATCH_VERSION: ${{ inputs.SMF_PLUGIN_PATCH_VERSION || '0' }}
49+
SMF_PLUGIN_PATCH_VERSION: ${{ inputs.SMF_PLUGIN_PATCH_VERSION || '-1' }}
5050
build_linux:
5151
uses: ./.github/workflows/ubuntu.yml
5252
with:

.github/workflows/docs/wireshark_smf_4-6-x_instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
### Windows Plugin Folder
1010
Personal Plugin Folder:
1111

12-
`%APPDATA%\Roaming\Wireshark\plugins\4.6\epan`
12+
`%APPDATA%\Wireshark\plugins\4.6\epan`
1313

1414
Global Plugin Folder:
1515

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ This project is a plugin for wireshark that will dissect Solace SMF protocol.
1616
3. Unzip the folder and place the .dll (Windows) or .so (Mac/Linux) file in the Wireshark plugin folder, under `epan`. The plugin folder path varies for each OS.
1717

1818
### Windows Plugin Folder
19-
Personal Plugin Folder:
19+
Personal Plugin Folder (version specific, use the wireshark major.minor):
2020

21-
`%APPDATA%\Roaming\Wireshark\plugins\4.0\epan`
21+
`%APPDATA%\Wireshark\plugins\4.6\epan`
2222

23-
Global Plugin Folder:
23+
Global Plugin Folder (version specific, use the wireshark major.minor):
2424

25-
`C:\Program Files\Wireshark\plugins\4.0\plugins\epan`
25+
`C:\Program Files\Wireshark\plugins\4.6\plugins\epan`
2626

2727
### macOS/Linux Plugin Folder
2828
Personal Plugin Folder:

src/smf/smf-analysis.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,10 @@ void smf_analysis_assuredctrl_param(tvbuff_t *tvb, packet_info* pinfo, uint8_t p
737737
void smf_analysis_assuredctrl(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree) {
738738
smf_analysis_assuredctrl_buf_t *smf_analysis_assuredctrl_buf_p = (smf_analysis_assuredctrl_buf_t *)p_get_proto_data(wmem_file_scope(), pinfo,
739739
getAssuredCtrlProto(), (uint32_t)tvb_raw_offset(tvb));
740+
if (NULL == smf_analysis_assuredctrl_buf_p) {
741+
// no more buffer to analyze, there were no parameters in the assuredctrl message. Just return
742+
return;
743+
}
740744
if (smf_analysis_assuredctrl_buf_p->numTransportMsg_m != 0 || smf_analysis_assuredctrl_buf_p->numAckedMsg_m != 0) {
741745
proto_item *item = proto_tree_add_item(tree, hf_assuredctrl_smf_analysis, tvb, 0, 0, ENC_NA);
742746
proto_item_set_generated(item);

0 commit comments

Comments
 (0)