Skip to content

Commit a9afcb1

Browse files
committed
unix/modffi.c: get_buffer is allowed to return NULL if len=0.
This is consistent with the logic in mp_get_buffer, and the code here is an inlined version of that function.
1 parent a62c106 commit a9afcb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unix/modffi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw,
375375
mp_obj_base_t *o = (mp_obj_base_t*)a;
376376
mp_buffer_info_t bufinfo;
377377
int ret = o->type->buffer_p.get_buffer(o, &bufinfo, MP_BUFFER_READ); // TODO: MP_BUFFER_READ?
378-
if (ret != 0 || bufinfo.buf == NULL) {
378+
if (ret != 0) {
379379
goto error;
380380
}
381381
values[i] = (ffi_arg)bufinfo.buf;

0 commit comments

Comments
 (0)