Skip to content

Commit 9dbe32b

Browse files
committed
Add a @NULLCHECK and an @assert for function name length
1 parent 8b89a33 commit 9dbe32b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/UDF.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# scalar functions
22
function registerfunc(db::SQLiteDB, nargs::Integer, func::Function, isdeterm::Bool=true; name="")
3+
@assert sizeof(name) <= 255 "size of function name must be <= 255"
34
@assert (-1 <= nargs <= 127) "nargs must follow the inequality -1 <= nargs <= 127"
45

56
name = isempty(name) ? string(func) : name::String

src/api.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ function sqlite3_create_function_v2(db::Ptr{Void},name::String,nargs::Integer,
297297
step::Ptr{Void},final::Ptr{Void},
298298
destructor::Ptr{Void})
299299
return ccall(
300+
@NULLCHECK db
300301
(:sqlite3_create_function_v2, sqlite3_lib),
301302
Cint,
302303
(Ptr{Void}, Ptr{Uint8}, Cint, Cint, Ptr{Void},

0 commit comments

Comments
 (0)