Skip to contentSkip to conversation

dpp: unref DPP frame if sending fails

PATCH In review James Prestwood 2 participants 3 messages Jan 7, 2022

lore
Share & tools
lore

James Prestwood

author
#0 lore raw

PATCH 1/2 dpp: unref DPP frame if sending fails

---
 src/dpp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
src/dpp.c +3 -1
index 54947193..f62bcebb 100644
@@ -219,8 +219,10 @@ static void dpp_send_frame(uint64_t wdev_id, struct iovec *iov, size_t iov_len,
 
 	l_debug("Sending frame on frequency %u", freq);
 
-	if (!l_genl_family_send(nl80211, msg, dpp_send_frame_cb, NULL, NULL))
+	if (!l_genl_family_send(nl80211, msg, dpp_send_frame_cb, NULL, NULL)) {
 		l_error("Could not send CMD_FRAME");
+		l_genl_msg_unref(msg);
+	}
 }
 
 static size_t dpp_build_header(const uint8_t *src, const uint8_t *dest,
Signature · 1 line
2.31.1
#1 lore raw

Hi James,

Quoted 4 lines · James Prestwood
---
  src/dpp.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

Both applied, thanks.

Regards,
-Denis

author
#2 lore raw

PATCH 2/2 dpp: memset header to fix uninitialized buffer

In reply to James Prestwood
---
 src/dpp.c | 2 ++
 1 file changed, 2 insertions(+)
src/dpp.c +2 -0
index f62bcebb..20c27a57 100644
@@ -656,6 +656,8 @@ static void dpp_send_config_response(struct dpp_sm *dpp, uint8_t status)
 	size_t json_len;
 	uint8_t *ptr = hdr + 24;
 
+	memset(hdr, 0, sizeof(hdr));
+
 	l_put_le16(0x00d0, hdr);
 	memcpy(hdr + 4, dpp->auth_addr, 6);
 	memcpy(hdr + 10, netdev_get_address(dpp->netdev), 6);
Signature · 1 line
2.31.1