[1.1.101] load() returns nil after updating from 1.1.100 to 1.1.101

Bugs that are actually features.
Samuel2507
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sun Aug 05, 2018 8:38 am
Contact:

[1.1.101] load() returns nil after updating from 1.1.100 to 1.1.101

Post by Samuel2507 »

After updating from 1.1.100 to 1.1.101 the behavior of load() seems to have changed / broken.
The mods i maintain use string.dump() and load() to copy functions, this worked until 1.1.100.

After updating to 1.1.101 load() just returns nil if fed with a string.dump( "Any function" ).

Example:

Create a random function:

Code: Select all

local test = function() return print("Hello world!") end
Call string.dump() and load() to copy the function:

Code: Select all

local dumped = string.dump(test)
local cloned = load(dumped)
Expected behavior:
As in 1.1.100, "cloned" contains a copy of "test"

Behavior in 1.1.101:
"cloned" is nil

A mod to reproduce this is attached.
Attachments
testmod_1.0.0.zip
(556 Bytes) Downloaded 31 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 14014
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.101] load() returns nil after updating from 1.1.100 to 1.1.101

Post by Rseding91 »

Thanks for the report. This was an intended change (that we seem to have forgotten to add to the changelog). load(...) now will not load binary blobs due to security concerns.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”