Fix max-value overflows in set_max_path_length
#3522
+26
−9
Merged