BTL2AP: compare strings with strcmp, not memcp

Otherwise a string shorter than 7 characters will trigger an out of bounds access

Bug: 12825
Change-Id: I54a7909d74838dcb56583374e5753f877ff74fe2
Reviewed-on: https://code.wireshark.org/review/17826
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
This commit is contained in:
Pascal Quantin 2016-09-21 11:09:43 +02:00 committed by Anders Broman
parent c2c8dc38fe
commit 7be73201a0
1 changed files with 1 additions and 2 deletions

View File

@ -22,7 +22,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
@ -1889,7 +1888,7 @@ dissect_disconnrequestresponse(tvbuff_t *tvb, int offset, packet_info *pinfo,
service_name = val_to_str_ext_const(uuid.bt_uuid, &bluetooth_uuid_vals_ext, "Unknown");
}
if (memcmp(service_name, "Unknown", 7) == 0) {
if (strcmp(service_name, "Unknown") == 0) {
service_name = val_to_str_const(psm, psm_vals, "Unknown");
}