Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp294310rwl; Wed, 9 Aug 2023 14:52:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEz8Vc8H0MKR8ycFczATsBxHQ1BpKFQnAxoItwm3nXOXK3RlSsVTbpR6TE00B6QHB0HUlxr X-Received: by 2002:a05:6a20:1613:b0:10f:1d33:d667 with SMTP id l19-20020a056a20161300b0010f1d33d667mr581169pzj.5.1691617976793; Wed, 09 Aug 2023 14:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691617976; cv=none; d=google.com; s=arc-20160816; b=HvL3+rsXZVnsS4m81nRXrqcZju4A2MfgGp9aGGyDsKkdumJlJrLW4mHhN+gs+IxK+9 rROarELD9GwxR3hKDM4A71uy1103PmKNQqJE9uvpni89U2EB5V6xiBGxxhou03WHsVut Nq1bheeiPCH80FM7z6jovr45ARaN/BfJhL/JqPmuY8O5B+/0G4hbweLEcHev4WnpIJoo SIobpcJLkdsGVQESYYERiTrhTKnvNHv6Vcm0mHcRubPsJnyO1BbCXofZOYY+VG17k+wE J66Wsf6AdCyFZ0nBkECEIik6d+2WYyUf39kdekSbp3D5PbuVC9wRU/4RyjYP0EM7Zt3B 8yTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4Ahhm4AMxcMsMJuFStapwtJ59L6eCNdHZgH1HquwUfI=; fh=2u86UswyZm6Kt7hgTSGDfCcYhr5NsxIN7ZtnExUEhXw=; b=fW180M7hw0MR3TwjOCMojSm35bvEQVUsGbj4WZkw5V7b8p4pRDyJ/bMcoqNPZglOXk 0HavZve0A90Tjax5V21ms9L3VQjbaFO16Z7WNpzEPXWN/pxiETO5RBNb2IJb35VxUuXp ZcxJpeAgcyhZ/aw7oc+GGEA+jibz7sy3l1gYYD9PLpct531QHI2/fI6UYA+EShmUpA/y ivRTJqJdlHSW7h8wEn0ktVIy1lzt0YMhDDsEg/ig8Q49PXOmicI7wT2OI5vAARAHoy5C yhRxdliY3Io8CvCHN9wgoBOIF3304gqJM6jauzCOQGZ+Uv16D3Gv6VwX6DwyPE7gj0Ea PKZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=EyVQjeaV; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ca37-20020a056a0206a500b00563e15edb8csi125474pgb.360.2023.08.09.14.52.23; Wed, 09 Aug 2023 14:52:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=EyVQjeaV; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbjHIVOz (ORCPT + 99 others); Wed, 9 Aug 2023 17:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbjHIU2E (ORCPT ); Wed, 9 Aug 2023 16:28:04 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A8071702 for ; Wed, 9 Aug 2023 13:28:04 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-99c93638322so39782766b.1 for ; Wed, 09 Aug 2023 13:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691612882; x=1692217682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4Ahhm4AMxcMsMJuFStapwtJ59L6eCNdHZgH1HquwUfI=; b=EyVQjeaVioLRFAomOryJk3hp01fQEGOA8Wh/vYFxF45DqHmz3VHd96y3RgVRg1XJGO HCLLXV+mGoj3oPhD/rydekzFP6tqR1gGeinLr4EWtkZ5FuhRRhYDingfszdAjXa+ZMWY hd46pAUwtY3UcP4HhWj/984OUoTaJPkE2D/j5HmtQsAqcLSJ6X/Yp0UEJtGVIgblNgzv yCdDLNAGRu0C/EfiH08wfEwERKWj0cmy3ThHRkXi0IFZg+f21n5DL2qx+i/UvXRTN2jC d7gaGVPDYTb2Koer4sMJX/t/1AF2SCmEfXu9kPjQ/SHU1REPG0Rafxk2kkUfk1/CD4GE 2YlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691612882; x=1692217682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Ahhm4AMxcMsMJuFStapwtJ59L6eCNdHZgH1HquwUfI=; b=SRs8vcXo1U+dH1LFssQF5LrPFJ+8PiCRsy4hRSpZ4yPSQ9o0U8KOUGo7Ga6ld0gGnk gIOqIl9QnqKrG2tm1VI+eVDiyhvoN9kvGpQIHVwu83BWCWrZgbcIc+nuq0Q0Z6VcXmYE 1KrXA/+0Qv8h+J5EYP6hN2xDWBTNFF3mt3GyyZCn/JigFl4j7vXRrVOZSSiVdcDyoIis 0Lget+xn5AmYydH7H8itZFV0AQ2YK0NCMeDqqv4N1q0nn8GHFDVG3TmCiJ1uHw81/8Ri 6pG0alXT7ESlY+qpmydxt/oqkgO+pmexAhqDbyRO50JH++f9ZWHVrY3yVyV6oiTBQkR1 pYpg== X-Gm-Message-State: AOJu0YyfZZQX8glOxDQCrEk2KLwGczZB19GnVf+xPQcttreW/IxsO3v2 uLx1aWZxQAJ57h36CUR6EjIn5DDpNcs= X-Received: by 2002:a17:906:315a:b0:99b:4bab:2841 with SMTP id e26-20020a170906315a00b0099b4bab2841mr671811eje.26.1691612881992; Wed, 09 Aug 2023 13:28:01 -0700 (PDT) Received: from localhost.localdomain (77-169-139-185.fixed.kpn.net. [77.169.139.185]) by smtp.gmail.com with ESMTPSA id h15-20020a1709066d8f00b00997e52cb30bsm8350819ejt.121.2023.08.09.13.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 13:28:01 -0700 (PDT) From: Bart Philips X-Google-Original-From: Bart Philips To: linux-bluetooth@vger.kernel.org Cc: Bart Philips Subject: [PATCH BlueZ 1/1] fix writing attributes of length 512 Date: Wed, 9 Aug 2023 22:27:23 +0200 Message-Id: <20230809202724.15429-2-bart.philips@inspiro.nl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230809202724.15429-1-bart.philips@inspiro.nl> References: <20230809202724.15429-1-bart.philips@inspiro.nl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- src/shared/gatt-server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c index 0512d06f6..c7ce3ec1f 100644 --- a/src/shared/gatt-server.c +++ b/src/shared/gatt-server.c @@ -846,7 +846,7 @@ static void write_cb(struct bt_att_chan *chan, uint8_t opcode, const void *pdu, DBG(server, "Write %s - handle: 0x%04x", (opcode == BT_ATT_OP_WRITE_REQ) ? "Req" : "Cmd", handle); - ecode = check_length(length, 0); + ecode = check_length(length - 2, 0); if (ecode) goto error; @@ -1333,7 +1333,7 @@ static void prep_write_cb(struct bt_att_chan *chan, uint8_t opcode, DBG(server, "Prep Write Req - handle: 0x%04x", handle); - ecode = check_length(length, offset); + ecode = check_length(length - 4, offset); if (ecode) goto error; -- 2.34.1