Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static size_t readerCallback(void *ptr, size_t size, size_t nmemb, void *stream)
len = lua_strlen(c->L, -1);
max = size * nmemb;
if (len > max) {
fprintf(stderr, "thrlua:readerCallback buffer overflow. Truncated len %zu max %zu\n", len, max);
thrlua_log(c->L, DCRITICAL, "thrlua:readerCallback buffer overflow. Truncated len %zu max %zu\n", len, max);
len = max;
}
memcpy(ptr, readBytes, len);
Expand Down
2 changes: 1 addition & 1 deletion modules/pcre.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int perform_regex(lua_State *thr, int mode)
if (bref >= sizeof(name) - 1 && walk < repend) {
if (walk[0] != '}') {
/* name was truncated, skip remaining and warn */
fprintf(stderr, "thrlua:perform_regex buffer overflow. Truncated max %zu\n", sizeof(name));
thrlua_log(thr, DCRITICAL, "thrlua:perform_regex buffer overflow. Truncated max %zu\n", sizeof(name));
while (walk < repend && walk[0] != '}') {
walk++;
}
Expand Down
7 changes: 4 additions & 3 deletions src/lgc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,11 +1481,12 @@ static GCheader *new_obj(lua_State *L, enum lua_obj_type tt,
o->tt = tt;
o->marked = !L->black;
o->xref = ck_pr_load_32(&G(L)->notxref);
make_grey(L, o);
/* The collector can be walking our heap, which isn't safe. So block it
* while we're adding to it */
/* Block the collector while modifying the heap.
* Insert into heap BEFORE make_grey to ensure the object is fully linked
* before it becomes visible to the GC via the grey stack. */
block_collector(L, pt);
TAILQ_INSERT_HEAD(&L->heap->objects, o, allocd);
make_grey(L, o);
unblock_collector(L, pt);

return o;
Expand Down