diff --git a/components/wpa_supplicant/src/common/sae.c b/components/wpa_supplicant/src/common/sae.c index a533c92346..fd26833e9d 100644 --- a/components/wpa_supplicant/src/common/sae.c +++ b/components/wpa_supplicant/src/common/sae.c @@ -2228,10 +2228,10 @@ int sae_write_confirm(struct sae_data *sae, struct wpabuf *buf) hash_len = sae->tmp->kck_len; /* Send-Confirm */ - sc = wpabuf_put(buf, 0); - wpabuf_put_le16(buf, sae->send_confirm); if (sae->send_confirm < 0xffff) sae->send_confirm++; + sc = wpabuf_put(buf, 0); + wpabuf_put_le16(buf, sae->send_confirm); if (sae->tmp->ec) { if (sae_cn_confirm_ecc(sae, sc, sae->tmp->own_commit_scalar,