Skip to content

Commit 9d5206a

Browse files
bugfix: invalid write in ffi.copy since we missed the len argument, it is caught by the valgrind mode in ec2 testing. (openresty#325)
1 parent 12abf47 commit 9d5206a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/resty/core/utils.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if subsystem == "http" then
3333

3434
local len = #str
3535
local buf = get_string_buf(len)
36-
ffi_copy(buf, str)
36+
ffi_copy(buf, str, len)
3737

3838
C.ngx_http_lua_ffi_str_replace_char(buf, len, byte(find),
3939
byte(replace))

0 commit comments

Comments
 (0)