mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-04-18 10:58:59 +08:00
Better handling of embeddings with two rare, but not unusual, files in them
I have encountered pickled embeddings with a short byteorder file at the top-level, as well as a .data/serialization_id file. Both load fine after allowing these files in the dataset. I do not think it is likely adding them to the safe unpickle regular expression would be a security risk, but that's for the maintainers to decide.
This commit is contained in:
parent
c5b7559856
commit
c5ae225418
@ -65,7 +65,7 @@ class RestrictedUnpickler(pickle.Unpickler):
|
|||||||
|
|
||||||
|
|
||||||
# Regular expression that accepts 'dirname/version', 'dirname/data.pkl', and 'dirname/data/<number>'
|
# Regular expression that accepts 'dirname/version', 'dirname/data.pkl', and 'dirname/data/<number>'
|
||||||
allowed_zip_names_re = re.compile(r"^([^/]+)/((data/\d+)|version|(data\.pkl))$")
|
allowed_zip_names_re = re.compile(r"^([^/]+)/((data/\d+)|byteorder|(\.data\/serialization_id)|version|(data\.pkl))$")
|
||||||
data_pkl_re = re.compile(r"^([^/]+)/data\.pkl$")
|
data_pkl_re = re.compile(r"^([^/]+)/data\.pkl$")
|
||||||
|
|
||||||
def check_zip_filenames(filename, names):
|
def check_zip_filenames(filename, names):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user