diff options
| -rw-r--r-- | locale/circuitpython.pot | 6 | ||||
| -rw-r--r-- | shared-bindings/socketpool/Socket.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index cf92b0584..71ef9adca 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 16:06+0530\n" +"POT-Creation-Date: 2020-10-16 13:56-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -2107,6 +2107,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: shared-bindings/socketpool/Socket.c +msgid "buffer too small for requested bytes" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index b0af57a5d..e7b31842d 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -257,6 +257,9 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) mp_int_t len = bufinfo.len; if (n_args == 3) { mp_int_t given_len = mp_obj_get_int(args[2]); + if (given_len > len) { + mp_raise_ValueError(translate("buffer too small for requested bytes")); + } if (given_len > 0 && given_len < len) { len = given_len; } |
