Skip to content

Commit

Permalink
fix: Avoid trying to store NUL char in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Mar 9, 2024
1 parent c6d6aa4 commit 35b7396
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion horde/classes/base/processing_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def set_generation(self, generation, things_per_sec, **kwargs):
# We return -1 to know to send a different error
if self.is_faulted():
return -1
self.generation = generation
# Sanitize NUL char away from string literal we store in the DB
self.generation = generation.replace("\x00", "\uFFFD")
# Support for two typical properties
self.seed = kwargs.get("seed", None)
self.gen_metadata = kwargs.get("gen_metadata", None)
Expand Down

0 comments on commit 35b7396

Please sign in to comment.