bluez/monitor/uuid.h
Michał Narajowski c318b332b8 monitor/l2cap: Fix buffer overflow when printing UUIDs
> ACL Data RX: Handle 76 flags 0x02 dlen 18                                                                                                                                                                          [hci0] 22.985107
      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute group list: 2 entries
        Handle range: 0x0001-0x0007
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0008-0x000b
        UUID: Generic Attribute Profile (0x1801)
< ACL Data TX: Handle 76 flags 0x00 dlen 11                                                                                                                                                                          [hci0] 22.985304
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000c-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                                                                               [hci0] 23.051113
        Num handles: 1
        Handle: 76
        Count: 1
> ACL Data RX: Handle 76 flags 0x02 dlen 26                                                                                                                                                                          [hci0] 23.115103
      ATT: Read By Group Type Response (0x11) len 21
        Attribute data length: 20
        Attribute group list: 1 entry
        Handle range: 0x000c-0x0010
*** buffer overflow detected ***: monitor/btmon terminated

==14384== Process terminating with default action of signal 6 (SIGABRT)
==14384==    at 0x4E6F418: raise (raise.c:54)
==14384==    by 0x4E71019: abort (abort.c:89)
==14384==    by 0x4EB1729: __libc_message (libc_fatal.c:175)
==14384==    by 0x4F5289B: __fortify_fail (fortify_fail.c:37)
==14384==    by 0x4F5089F: __chk_fail (chk_fail.c:28)
==14384==    by 0x4F4FE08: _IO_str_chk_overflow (vsprintf_chk.c:31)
==14384==    by 0x4EB55DF: _IO_default_xsputn (genops.c:455)
==14384==    by 0x4E87DBF: vfprintf (vfprintf.c:1631)
==14384==    by 0x4F4FE93: __vsprintf_chk (vsprintf_chk.c:82)
==14384==    by 0x4F4FDEC: __sprintf_chk (sprintf_chk.c:31)
==14384==    by 0x422826: sprintf (stdio2.h:33)
==14384==    by 0x422826: print_uuid (l2cap.c:2014)
==14384==    by 0x423373: print_group_list (l2cap.c:2334)
==14384==    by 0x423373: att_read_group_type_rsp (l2cap.c:2348)
2016-08-12 22:48:10 +03:00

32 lines
1.1 KiB
C

/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2011-2014 Intel Corporation
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <stdint.h>
#define MAX_LEN_UUID_STR 37
const char *uuid16_to_str(uint16_t uuid);
const char *uuid32_to_str(uint32_t uuid);
const char *uuidstr_to_str(const char *uuid);