aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorUlf <ulf33286@gmail.com>2017-08-22 21:52:29 -0400
committerMichael Mann <mmann78@netscape.net>2017-08-23 02:58:08 +0000
commit5574b78dae2f607d4ace66ab60d516d0c569357d (patch)
tree00dde2f755b716aefed1eb7857683673eecb7203 /plugins
parent5c27cb5f83cb2c89cf470a6203fe057d3fa7e322 (diff)
Fix potential oob write crashes
Bug: 13847 Change-Id: I3a706db25204fe4c1fd1b7be3b17b8c55365dccf Reviewed-on: https://code.wireshark.org/review/23169 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index 1ac755e..a716eaf 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -9457,7 +9457,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
if((strstr(puffer, vendorIdStr)) != NULL) {
memset (convertStr, 0, sizeof(*convertStr));
pch = strstr(puffer, vendorIdStr);
- if (pch!= NULL && sscanf(pch, "VendorID=\"%[^\"]", convertStr) == 1) {
+ if (pch!= NULL && sscanf(pch, "VendorID=\"%199[^\"]", convertStr) == 1) {
read_vendor_id = (guint32) strtoul (convertStr, NULL, 0);
if(read_vendor_id == searchVendorID) {
@@ -9470,7 +9470,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
if((strstr(puffer, deviceIdStr)) != NULL) {
memset(convertStr, 0, sizeof(*convertStr));
pch = strstr(puffer, deviceIdStr);
- if (pch != NULL && sscanf(pch, "DeviceID=\"%[^\"]", convertStr) == 1) {
+ if (pch != NULL && sscanf(pch, "DeviceID=\"%199[^\"]", convertStr) == 1) {
read_device_id = (guint32)strtoul(convertStr, NULL, 0);
if(read_device_id == searchDeviceID) {
@@ -9604,7 +9604,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
memset (convertStr, 0, sizeof(*convertStr));
pch = strstr(temp, fParameterIndexStr);
- if (pch != NULL && sscanf(pch, "Index=\"%[^\"]", convertStr) == 1) {
+ if (pch != NULL && sscanf(pch, "Index=\"%199[^\"]", convertStr) == 1) {
io_data_object->fParameterIndexNr = (guint32)strtoul(convertStr, NULL, 0);
}
break; /* found Indexnumber -> break search loop */
@@ -9618,7 +9618,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
if((strstr(temp, moduleStr)) != NULL) { /* find the String "ModuleIdentNumber=" */
memset (convertStr, 0, sizeof(*convertStr));
pch = strstr(temp, moduleStr); /* search for "ModuleIdentNumber=\"" within GSD-file */
- if (pch != NULL && sscanf(pch, "ModuleIdentNumber=\"%[^\"]", convertStr) == 1) { /* Change format of Value string-->numeric string */
+ if (pch != NULL && sscanf(pch, "ModuleIdentNumber=\"%199[^\"]", convertStr) == 1) { /* Change format of Value string-->numeric string */
read_module_id = (guint32)strtoul(convertStr, NULL, 0); /* Change numeric string --> unsigned long; read_module_id contains the Value of the ModuleIdentNumber */
/* If the found ModuleID matches with the wanted ModuleID, search for the Submodule and break */
@@ -9629,7 +9629,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
if((strstr(temp, moduleNameInfo)) != NULL) { /* find the String "<Name" for the TextID */
long filePosRecord;
- if (sscanf(temp, "%*s TextId=\"%[^\"]", tmp_moduletext) != 1) /* saves the correct TextId for the next searchloop */
+ if (sscanf(temp, "%*s TextId=\"%199[^\"]", tmp_moduletext) != 1) /* saves the correct TextId for the next searchloop */
break;
filePosRecord = ftell(fp); /* save the current position of the filepointer (Offset) */
@@ -9652,7 +9652,7 @@ dissect_ExpectedSubmoduleBlockReq_block(tvbuff_t *tvb, int offset,
if((strstr(temp, subModuleStr)) != NULL) {
memset (convertStr, 0, sizeof(*convertStr));
pch = strstr(temp, subModuleStr);
- if (pch != NULL && sscanf(pch, "SubmoduleIdentNumber=\"%[^\"]", convertStr) == 1) {
+ if (pch != NULL && sscanf(pch, "SubmoduleIdentNumber=\"%199[^\"]", convertStr) == 1) {
read_submodule_id = (guint32) strtoul (convertStr, NULL, 0); /* read_submodule_id contains the Value of the SubModuleIdentNumber */
/* Find "PROFIsafeSupported" flag of the module in GSD-file */