8000 WIP extmod/modussl_axtls: Check NULL return from mp_obj_str_get_data. · micropython/micropython@4561694 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4561694

Browse files
committed
WIP extmod/modussl_axtls: Check NULL return from mp_obj_str_get_data.
1 parent 7885d49 commit 4561694

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

extmod/modussl_axtls.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ STATIC mp_obj_t ussl_socket_new(mp_obj_t sock, struct ssl_args *args) {
8686
}
8787

8888
data = (const byte*)mp_obj_str_get_data(args->cert.u_obj, &len);
89+
if (data == NULL) {
90+
return MP_OBJ_NULL;
91+
}
8992
res = ssl_obj_memory_load(o->ssl_ctx, SSL_OBJ_X509_CERT, data, len, NULL);
9093
if (res != SSL_OK) {
9194
return mp_raise_ValueError_o("invalid cert");

0 commit comments

Comments
 (0)
0