Re: [PATCH (BUGFIX)] gitweb: Fix "Use of uninitialized value" error in 'history' view

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

 



Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Jakub Narebski <jnareb@xxxxxxxxx> writes:
> 
> > When asked for history of a file with no $hash ('h') parameter set,
> > and which file is not present in current branch ("HEAD" or given by
> > $hash_hase ('hb') parameter), but is present deeper in the full
> > history of a branch, gitweb would spew multiple of "Use of
> > uninitialized value" warnings, and some links would be missing.
> > This commit fixes this bug.
> 
> Thanks, does gitweb itself generate such a link?
> 
> I can _artificially_ reproduce this, and I can also see that the patch
> would solve it, so I do not mind applying it, but I am curious how this
> was originally triggered.

Actually I came across this error when testing the "context-sensitive
feed links" patch, and was hand-crafting (munging) gitweb URLs.

But after thinking about this bug a bit I have realized that this
situation _can_ happen with link generated by gitweb, only in very rare
cases.  It is enough if you use 'history' view link without $hash ('h')
parameter, and with transient $hash_base ('hb') parameter, i.e. either
name of branch, or "HEAD", or not set (implies "HEAD"), and happen into
situation where file was _deleted_ *between* gitweb link creation and
following (accessing) this link.  For example 'history' links in 'tree'
and 'commitdiff' views doesn't have 'h' parameter.  Also the 'history'
link in navigation bar wouldn't have 'h' parameter if 'blob' or 'tree'
view where it is in doesn't have it.

-- 
Jakub Narebski
Poland
--
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]

  Powered by Linux