<feed xmlns='http://www.w3.org/2005/Atom'>
<title>halibut/wcwidth.c, branch master</title>
<subtitle>My halibut tree</subtitle>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/'/>
<entry>
<title>Fix two potential buffer under/overruns.</title>
<updated>2017-05-14T07:49:07+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2017-05-14T07:08:57+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=41ef29132b50404f6157d83d1edf9a133e422c9f'/>
<id>41ef29132b50404f6157d83d1edf9a133e422c9f</id>
<content type='text'>
The one in wcwidth.c actually came up in one of my valgrind runs: if
you passed it a non-null-terminated wide string (specifically, one
that reaches invalid memory exactly when the length parameter runs
out), it would illegally load the character beyond the end of the
string before noticing that the length parameter said it shouldn't.

The one in bk_man.c may well not be able to come up at all, but I
spotted it in passing and I thought I might as well fix it - it makes
me twitch on general principles to see any use of buf[len-1] without
having checked len&gt;0 first.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The one in wcwidth.c actually came up in one of my valgrind runs: if
you passed it a non-null-terminated wide string (specifically, one
that reaches invalid memory exactly when the length parameter runs
out), it would illegally load the character beyond the end of the
string before noticing that the length parameter said it shouldn't.

The one in bk_man.c may well not be able to come up at all, but I
spotted it in passing and I thought I might as well fix it - it makes
me twitch on general principles to see any use of buf[len-1] without
having checked len&gt;0 first.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove a bunch of unused variables spotted by Ubuntu 12.04's gcc.</title>
<updated>2012-05-03T17:43:21+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2012-05-03T17:43:21+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=689093cc870e60ab82a176c33613fa0aeaa0bf69'/>
<id>689093cc870e60ab82a176c33613fa0aeaa0bf69</id>
<content type='text'>
[originally from svn r9478]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[originally from svn r9478]
</pre>
</div>
</content>
</entry>
<entry>
<title>bk_text and bk_info both need to know the on-screen width of</title>
<updated>2004-04-22T17:47:28+00:00</updated>
<author>
<name>Simon Tatham</name>
<email>anakin@pobox.com</email>
</author>
<published>2004-04-22T17:47:28+00:00</published>
<link rel='alternate' type='text/html' href='https://www.franklinwei.com/cgit/halibut/commit/?id=3e7ac03ca71c9b93c73fa58fd1de9a2042ec13d7'/>
<id>3e7ac03ca71c9b93c73fa58fd1de9a2042ec13d7</id>
<content type='text'>
characters in order to wrap and align them properly. Therefore, they
should be using wcwidth(). So here are a couple of wrappers on
wcwidth(), one which filters out the Unicode characters not
representable in the target charset, and one which converts _from_ a
charset to Unicode before calling wcwidth(). bk_text and bk_info
should now align correctly even in the face of unsupported
characters and Japanese.

[originally from svn r4116]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
characters in order to wrap and align them properly. Therefore, they
should be using wcwidth(). So here are a couple of wrappers on
wcwidth(), one which filters out the Unicode characters not
representable in the target charset, and one which converts _from_ a
charset to Unicode before calling wcwidth(). bk_text and bk_info
should now align correctly even in the face of unsupported
characters and Japanese.

[originally from svn r4116]
</pre>
</div>
</content>
</entry>
</feed>
