Guard the value iterator in method.insert.list

The list branch dereferenced end() when no value was given.
This commit is contained in:
noctuum
2026-09-16 16:27:47 +05:00
committed by Jari Sundell
parent c32b56e9d8
commit 3717649bb3
3 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ system_method_insert_object(const torrent::Object::list_type& args, int flags) {
torrent::Object valueList = torrent::Object::create_list();
torrent::Object::list_type& valueListType = valueList.as_list();
if ((itrArgs)->is_list())
if (itrArgs != args.end() && (itrArgs)->is_list())
valueListType = (itrArgs)->as_list();
control->object_storage()->insert_str(raw_key, valueList, flags);