Commit Diff


commit - 946e0798ea070c1d164ea048bbbb316f748e7365
commit + e28099979b03e56c094eb0e2f04137b96510f632
blob - d23a25ebbb9e0f35c608509ec09007188e890e52
blob + 885867f78e6977f47b4133b83b2d41c0603514ef
--- libexec/got-send-pack/got-send-pack.c
+++ libexec/got-send-pack/got-send-pack.c
@@ -351,6 +351,13 @@ send_pack(int fd, struct got_pathlist_head *refs,
 		if (err)
 			goto done;
 		if (is_firstpkt) {
+			if (server_capabilities == NULL) {
+				server_capabilities = strdup("");
+				if (server_capabilities == NULL) {
+					err = got_error_from_errno("strdup");
+					goto done;
+				}
+			}
 			if (chattygot && server_capabilities[0] != '\0')
 				fprintf(stderr, "%s: server capabilities: %s\n",
 				    getprogname(), server_capabilities);
@@ -361,7 +368,8 @@ send_pack(int fd, struct got_pathlist_head *refs,
 				goto done;
 			if (chattygot)
 				fprintf(stderr, "%s: my capabilities:%s\n",
-				    getprogname(), my_capabilities);
+				    getprogname(),
+				    my_capabilities ? my_capabilities : "");
 			is_firstpkt = 0;
 		}
 		if (strstr(refname, "^{}")) {