Re: [PATCH v2 0/25] prune-safety

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 16, 2014 at 05:39:18PM -0400, Jeff King wrote:

> @@ -301,6 +297,14 @@ static struct commit *handle_commit(struct rev_info *revs,
>  			die("bad object %s", sha1_to_hex(tag->tagged->sha1));
>  		}
>  		object->flags |= flags;
> +		/*
> +		 * We'll handle the tagged object by looping or dropping
> +		 * through to the non-tag handlers below. Do not
> +		 * propagate data from the tag's pending entry.
> +		 */
> +		name = NULL;
> +		path = NULL;
> +		mode = 0;

Hmm. On second thought (and after seeing a warning from Coverity), this
should be:

diff --git a/revision.c b/revision.c
index 8030fc8..ebe3e93 100644
--- a/revision.c
+++ b/revision.c
@@ -302,7 +302,7 @@ static struct commit *handle_commit(struct rev_info *revs,
 		 * through to the non-tag handlers below. Do not
 		 * propagate data from the tag's pending entry.
 		 */
-		name = NULL;
+		name = "";
 		path = NULL;
 		mode = 0;
 	}

The rest of the function assumes that name is not NULL (which I'm not
sure is entirely safe, as add_pending_object can take a NULL; presumably
every "add" uses the empty string instead of NULL. But either way,
setting it to NULL here is definite wrong).

The "path" field is explicitly OK to be NULL.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]