From: Lukas Fleischer Date: Tue, 5 Apr 2011 08:38:53 +0000 (+0200) Subject: Avoid null pointer dereference in cgit_print_diff(). X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/9afc883297b0d0943e9b358d2299950f33e8e5ed?hp=9afc883297b0d0943e9b358d2299950f33e8e5ed Avoid null pointer dereference in cgit_print_diff(). When calling cgit_print_diff() with a bad new_rev and a NULL old_rev, checking for new_rev's parent commit will result in a null pointer dereference. Returning on an invalid commit before dereferencing fixes this. Spotted with clang-analyzer. Signed-off-by: Lukas Fleischer Signed-off-by: Lars Hjemli ---