Skip to content

fix(radio): check for negative credential lengths#49

Open
deadprogram wants to merge 1 commit into
mainfrom
protect-ssid-length
Open

fix(radio): check for negative credential lengths#49
deadprogram wants to merge 1 commit into
mainfrom
protect-ssid-length

Conversation

@deadprogram
Copy link
Copy Markdown
Member

Reject negative ssid_len and pwd_len in station and AP configurations to prevent integer/cast wrap-around that causes out-of-bounds memcpy.

Orginally suggested by PR #48 thanks!

Reject negative ssid_len and pwd_len in station and AP configurations
to prevent integer/cast wrap-around that causes out-of-bounds memcpy.

Orginally suggested by PR #48 thanks!

Signed-off-by: deadprogram <ron@hybridgroup.com>
Comment thread radio.c
}
wifi_config_t cfg;
memset(&cfg, 0, sizeof(cfg));
if (ssid_len > 32) ssid_len = 32;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this also uncovers the silent ignore for ssid/pass longer than expected being just truncated to 32/64 chars - wouldn't it be better to return error here also? (and probably check this in user code for nicer errors?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants