Description: In the methods handler_remove_engine and handler_remove_interlocker, we want to NOT fulfill the request if the name of the object to remove is null OR the name equals the name of the default object which is supposed to be unremovable.
In handler_remove_engine, the check looks like this: if (name == NULL && engine_is_unremovable(name)) { //not allowed, error message }
which means: If the name is null AND the name matches the name of the default object which shouldn't be removed. This should be an OR instead. Because the name of the default object is not 'null', this if condition can never evaluate to true.
The problem is pretty much the same in handler_remove_interlocker; a logical OR needs to be used instead of a logical AND.
Consequences: If this is not corrected, the default (supposedly unremovable) objects could maybe be deleted.
File in question: server/src/handler_upload.c
Description: In the methods handler_remove_engine and handler_remove_interlocker, we want to NOT fulfill the request if the name of the object to remove is null OR the name equals the name of the default object which is supposed to be unremovable.
In handler_remove_engine, the check looks like this:
if (name == NULL && engine_is_unremovable(name)) { //not allowed, error message }
which means: If the name is null AND the name matches the name of the default object which shouldn't be removed. This should be an OR instead. Because the name of the default object is not 'null', this if condition can never evaluate to true.
The problem is pretty much the same in handler_remove_interlocker; a logical OR needs to be used instead of a logical AND.
Consequences: If this is not corrected, the default (supposedly unremovable) objects could maybe be deleted.
Fix: Switch
&&
to||
.