Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
4b235800
Commit
4b235800
authored
May 11, 2017
by
puuu
Committed by
Damien George
May 16, 2017
Browse files
esp8266/modnetwork: In connect, fix potential buffer overflows.
parent
162a0f94
Changes
1
Hide whitespace changes
Inline
Side-by-side
esp8266/modnetwork.c
View file @
4b235800
...
...
@@ -102,13 +102,13 @@ STATIC mp_obj_t esp_connect(mp_uint_t n_args, const mp_obj_t *args) {
if
(
n_args
>
1
)
{
p
=
mp_obj_str_get_data
(
args
[
1
],
&
len
);
len
=
MIN
(
len
,
sizeof
(
config
.
ssid
));
memcpy
(
config
.
ssid
,
p
,
len
);
if
(
n_args
>
2
)
{
p
=
mp_obj_str_get_data
(
args
[
2
],
&
len
);
}
else
{
p
=
""
;
len
=
MIN
(
len
,
sizeof
(
config
.
password
));
memcpy
(
config
.
password
,
p
,
len
)
;
}
memcpy
(
config
.
password
,
p
,
len
);
error_check
(
wifi_station_set_config
(
&
config
),
"Cannot set STA config"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment