From 1c32e008c8fda46f812c38f46ae7515bcf8002ee Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 7 Apr 2013 15:06:23 +0100 Subject: ui-blob: don't segfault when no path is given It it possible to inspect blobs by specifying only the SHA-1, and CGit provides links to do so, for example if a tag points directly at a blob. In this case the path_items structure is never used, but creating it still causes strlen to be run on a null pointer. Fix this. This error was introduced by commit c1633c6 (Update git to v1.7.6.5 - 2013-03-02). Signed-off-by: John Keeping --- ui-blob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-blob.c b/ui-blob.c index c59fbcb..7aec0b1 100644 --- a/ui-blob.c +++ b/ui-blob.c @@ -80,7 +80,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head) struct commit *commit; struct pathspec_item path_items = { .match = path, - .len = strlen(path) + .len = path ? strlen(path) : 0 }; struct pathspec paths = { .nr = 1, -- cgit 1.4.1 /a> log tree commit diff
Commit message (Expand)Author
2021-02-07Adjust brightness by smaller incrementsJune McEnroe
2021-02-07Fix cwm window cycling, move big by defaultJune McEnroe
2021-02-07Use class names for Foreground, Background, BorderColorJune McEnroe
2021-02-07Add simple battery status and clock to xsessionJune McEnroe
2021-02-07Set cursor theme and sizeJune McEnroe
2021-02-07Use scrot for up -s if no screencaptureJune McEnroe
2021-02-07Enable mouse acceleration in XJune McEnroe
2021-02-07Set colours for Xt and cwmJune McEnroe
2021-02-07Set urgency on bell in xtermJune McEnroe
2021-02-07Add bindings for brightness controlJune McEnroe
2021-02-07Set X key repeat rateJune McEnroe
2021-02-07Bump font size to 12June McEnroe
2021-02-07Fully configure and rebind cwmJune McEnroe
2021-02-07Add BintiJune McEnroe
2021-02-07Finish configuring xtermJune McEnroe
2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe
2021-02-06Set root window to black on purple snowJune McEnroe
2021-02-06Add xmodmap configurationJune McEnroe
2021-02-06Add initial OpenBSD X configurationJune McEnroe
2021-02-06Add xterm output to schemeJune McEnroe