Skip to content

Commit 5f1e21d

Browse files
committed
guard oversized blob length in callbackRetBlob
1 parent 78b95b7 commit 5f1e21d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

callback.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ func callbackRetBlob(ctx *C.sqlite3_context, v reflect.Value) error {
336336
C.sqlite3_result_null(ctx)
337337
} else {
338338
bs := i.([]byte)
339+
if i64 && len(bs) > math.MaxInt32 {
340+
C.sqlite3_result_error_toobig(ctx)
341+
return nil
342+
}
339343
C._sqlite3_result_blob(ctx, unsafe.Pointer(&bs[0]), C.int(len(bs)))
340344
}
341345
return nil

0 commit comments

Comments
 (0)