<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgit/cache.c, branch lf/filter</title>
<subtitle>A hyperfast web frontend for git repositories written in C.</subtitle>
<id>http://git.cetero.st/cgit/atom/cache.c?h=lf%2Ffilter</id>
<link rel='self' href='http://git.cetero.st/cgit/atom/cache.c?h=lf%2Ffilter'/>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/'/>
<updated>2014-01-12T18:32:20Z</updated>
<entry>
<title>cache: don't leave cache_slot fields uninitialized</title>
<updated>2014-01-12T18:32:20Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-01-12T16:49:40Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=382ecf152e1bd9546f6c84ace71c62ca07f6648b'/>
<id>urn:sha1:382ecf152e1bd9546f6c84ace71c62ca07f6648b</id>
<content type='text'>
Valgrind says:

==18344== Conditional jump or move depends on uninitialised value(s)
==18344==    at 0x406C83: open_slot (cache.c:63)
==18344==    by 0x407478: cache_ls (cache.c:403)
==18344==    by 0x404C9A: process_request (cgit.c:639)
==18344==    by 0x406BD2: fill_slot (cache.c:190)
==18344==    by 0x4071A0: cache_process (cache.c:284)
==18344==    by 0x404461: main (cgit.c:952)
==18344==  Uninitialised value was created by a stack allocation
==18344==    at 0x40738B: cache_ls (cache.c:375)

This is caused by the keylen field being used to calculate whether or
not a slot is matched.  We never then check the value of this and the
length of data read depends on the key length read from the file so this
isn't dangerous, but it's nice to avoid branching based on uninitialized
data.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
</entry>
<entry>
<title>Update copyright information</title>
<updated>2014-01-08T14:10:49Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@crytocrack.de</email>
</author>
<published>2014-01-08T14:10:49Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=f7f26f88755ac6a3b9af4918b51b0d6e7a692c78'/>
<id>urn:sha1:f7f26f88755ac6a3b9af4918b51b0d6e7a692c78</id>
<content type='text'>
* Name "cgit Development Team" as copyright holder to avoid listing
  every single developer.

* Update copyright ranges.

Signed-off-by: Lukas Fleischer &lt;cgit@crytocrack.de&gt;
</content>
</entry>
<entry>
<title>cache.c: cache ls_cache output properly</title>
<updated>2013-05-22T10:53:06Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2013-05-18T17:46:39Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=f32a2da636ffa6eaa6b8d0d3f35a673fa12e404a'/>
<id>urn:sha1:f32a2da636ffa6eaa6b8d0d3f35a673fa12e404a</id>
<content type='text'>
By using the standard library's printf, cache_ls does not redirect its
output to the cache when we change the process' stdout file descriptor
to point to the cache file.  Fix this by using "htmlf" in the same way
that we do for writing HTTP headers.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
</entry>
<entry>
<title>cache.c: fix cache_ls</title>
<updated>2013-05-18T17:45:28Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2013-05-18T17:28:14Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=f75900b04f73725c00abb46405b51ade59313ecc'/>
<id>urn:sha1:f75900b04f73725c00abb46405b51ade59313ecc</id>
<content type='text'>
Commit fb3655d (use struct strbuf instead of static buffers, 2013-04-06)
broke the logic in cache.c::cache_ls by failing to set slot-&gt;cache_name
before calling open_slot.

While fixing this, also free the strbufs added by that commit once we're
done with them.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
</entry>
<entry>
<title>use struct strbuf instead of static buffers</title>
<updated>2013-04-08T14:12:52Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2013-04-06T09:28:57Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=fb3655df3bf85bd405c5921bbd4b3a54c705c839'/>
<id>urn:sha1:fb3655df3bf85bd405c5921bbd4b3a54c705c839</id>
<content type='text'>
Use "struct strbuf" from Git to remove the limit on file path length.

Notes on scan-tree:
This is slightly involved since I decided to pass the strbuf into
add_repo() and modify if whenever a new file name is required, which
should avoid any extra allocations within that function.  The pattern
there is to append the filename, use it and then reset the buffer to its
original length (retaining a trailing '/').

Notes on ui-snapshot:
Since write_archive modifies the argv array passed to it we
copy the argv_array values into a new array of char* and then free the
original argv_array structure and the new array without worrying about
what the values now look like.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
</content>
</entry>
<entry>
<title>Mark several functions/variables static</title>
<updated>2013-03-05T00:50:39Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2013-03-04T07:52:33Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=bafab423f20bc1448b293842c235965e1681f07e'/>
<id>urn:sha1:bafab423f20bc1448b293842c235965e1681f07e</id>
<content type='text'>
Spotted by parsing the output of `gcc -Wmissing-prototypes [...]`.

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>White space around control verbs.</title>
<updated>2013-03-04T14:12:54Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2013-03-04T04:21:33Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e'/>
<id>urn:sha1:bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>Fix several whitespace errors</title>
<updated>2013-03-04T00:12:48Z</updated>
<author>
<name>Lukas Fleischer</name>
<email>cgit@cryptocrack.de</email>
</author>
<published>2013-03-03T15:04:29Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=53bc747d311d18642fa3ad0cc0de34f3899ed1f4'/>
<id>urn:sha1:53bc747d311d18642fa3ad0cc0de34f3899ed1f4</id>
<content type='text'>
* Remove whitespace at the end of lines.
* Replace space indentation by tabs.
* Add whitespace before/after several operators ("+", "-", "*", ...)
* Add whitespace to assignments ("foo = bar;").
* Fix whitespace in parameter lists ("foobar(foo, bar, 42)").

Signed-off-by: Lukas Fleischer &lt;cgit@cryptocrack.de&gt;
</content>
</entry>
<entry>
<title>Fix some warnings to allow -Werror</title>
<updated>2008-11-06T18:18:07Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2008-11-04T19:22:08Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=bdd4a56ad55720cde3b7b290b6b9fe4c57dc4f01'/>
<id>urn:sha1:bdd4a56ad55720cde3b7b290b6b9fe4c57dc4f01</id>
<content type='text'>
The type used to declare the st_size field of a 'struct stat' can
be a 32- or 64-bit sized type, which can vary from one platform to
another, or even from one compilation to another.  In particular,
on linux, if you include the following define:

    #define _FILE_OFFSET_BITS 64

prior to including certain system header files, then the type used
for the st_size field will be __off64_t, otherwise it will be an
__off_t.  Note that the above define is included at the top of
git-compat-util.h.

In cache.c, the "%zd" format specifier expects a "signed size_t",
another type which can vary, when an __off64_t or a __off_t is
provided.  To supress the warning, use the PRIuMAX format specifier
and cast the st_size field to uintmax_t.  This should work an any
platform for which git currently compiles.

In ui-plain.c, the size parameter of sha1_object_info() and
read_sha1_file() is defined to be "unsigned long *" not "size_t *".
So, to supress the warning, simply declare size with the correct type.

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>cache.c: use %zd for off_t argument</title>
<updated>2008-09-01T20:39:00Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2008-08-10T07:24:24Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=2cecf839a06ce951db0d5d95abf79004eff33ca7'/>
<id>urn:sha1:2cecf839a06ce951db0d5d95abf79004eff33ca7</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail&gt;
</content>
</entry>
</feed>
