btio: Fix BASE copy from getsockopt()
authorClaudia Draghicescu <claudia.rosu@nxp.com>
Wed, 6 Sep 2023 11:42:34 +0000 (14:42 +0300)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:04 +0000 (19:04 +0530)
Fix copy of BASE from getsockopt() and update base length.

btio/btio.c

index 96f0d2c81dd42e3574943f5163ae610ae199478e..f500a2328db55499beb9c524679b1f5ff97a4e4a 100755 (executable)
@@ -1649,10 +1649,12 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
                return FALSE;
        }
 
-       if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_BASE, &base, &len) < 0) {
+       if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_BASE,
+                       &base.base, &len) < 0) {
                ERROR_FAILED(err, "getsockopt(BT_ISO_BASE)", errno);
                return FALSE;
        }
+       base.base_len = len;
 
        if (!get_src(sock, &src, sizeof(src), err))
                return FALSE;