<feed xmlns='http://www.w3.org/2005/Atom'>
<title>plan9port/src/libdraw, branch patch</title>
<subtitle>Plan 9 from User Space (with patches)</subtitle>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/'/>
<entry>
<title>libdraw: fix subfont scaling</title>
<updated>2023-08-21T15:38:17+00:00</updated>
<author>
<name>matheuristic</name>
<email>matheuristic@users.noreply.github.com</email>
</author>
<published>2023-08-21T00:57:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=a36e66f0d200f99802ad32171c55d26ad44f501d'/>
<id>a36e66f0d200f99802ad32171c55d26ad44f501d</id>
<content type='text'>
A subfont with n chars has n+1 Fontchars, so scalesubfont() needs to
scale all n+1 info entries.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A subfont with n chars has n+1 Fontchars, so scalesubfont() needs to
scale all n+1 info entries.
</pre>
</div>
</content>
</entry>
<entry>
<title>Bail out if convW2M(...) indicates failure.</title>
<updated>2022-07-26T16:12:05+00:00</updated>
<author>
<name>Igor Böhm</name>
<email>boehm.igor@gmail.com</email>
</author>
<published>2020-07-25T19:54:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=07b24459ea4f06f7e86b7c4557eea5b451354575'/>
<id>07b24459ea4f06f7e86b7c4557eea5b451354575</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libdraw: fix out-of-bounds access to local buffer in event.c:startrpc()</title>
<updated>2022-07-26T16:12:05+00:00</updated>
<author>
<name>Igor Böhm</name>
<email>boehm.igor@gmail.com</email>
</author>
<published>2020-07-25T00:17:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=d92ac2d1b424e059e8e81d6dd58f0ac195fe3253'/>
<id>d92ac2d1b424e059e8e81d6dd58f0ac195fe3253</id>
<content type='text'>
The function `startrpc()` stack allocates a local buffer of size 100:

```c
static Muxrpc*
startrpc(int type)
{
	uchar buf[100];
	      ^^^^^^^^
	Wsysmsg w;

	w.type = type;
	convW2M(&amp;w, buf, sizeof buf);
	return muxrpcstart(display-&gt;mux, buf);
}
```

The function `convW2M()` is called passing `buf`. That function accesses
`buf` out-of-bounds:

```c
uint
convW2M(Wsysmsg *m, uchar *p, uint n)
{
  ...
  case Tcursor2:
    PUT(p+6, m-&gt;cursor.offset.x);
    PUT(p+10, m-&gt;cursor.offset.y);
    memmove(p+14, m-&gt;cursor.clr, sizeof m-&gt;cursor.clr);
    memmove(p+46, m-&gt;cursor.set, sizeof m-&gt;cursor.set);
    PUT(p+78, m-&gt;cursor2.offset.x);
    PUT(p+82, m-&gt;cursor2.offset.y);
    memmove(p+86, m-&gt;cursor2.clr, sizeof m-&gt;cursor2.clr);
    memmove(p+214, m-&gt;cursor2.set, sizeof m-&gt;cursor2.set);
    p[342] = m-&gt;arrowcursor;
    ^^^^^^
```

To fix the issue the size of local variable `buf` is increased from 100
to 512 to avoid out-of-bounds array access.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function `startrpc()` stack allocates a local buffer of size 100:

```c
static Muxrpc*
startrpc(int type)
{
	uchar buf[100];
	      ^^^^^^^^
	Wsysmsg w;

	w.type = type;
	convW2M(&amp;w, buf, sizeof buf);
	return muxrpcstart(display-&gt;mux, buf);
}
```

The function `convW2M()` is called passing `buf`. That function accesses
`buf` out-of-bounds:

```c
uint
convW2M(Wsysmsg *m, uchar *p, uint n)
{
  ...
  case Tcursor2:
    PUT(p+6, m-&gt;cursor.offset.x);
    PUT(p+10, m-&gt;cursor.offset.y);
    memmove(p+14, m-&gt;cursor.clr, sizeof m-&gt;cursor.clr);
    memmove(p+46, m-&gt;cursor.set, sizeof m-&gt;cursor.set);
    PUT(p+78, m-&gt;cursor2.offset.x);
    PUT(p+82, m-&gt;cursor2.offset.y);
    memmove(p+86, m-&gt;cursor2.clr, sizeof m-&gt;cursor2.clr);
    memmove(p+214, m-&gt;cursor2.set, sizeof m-&gt;cursor2.set);
    p[342] = m-&gt;arrowcursor;
    ^^^^^^
```

To fix the issue the size of local variable `buf` is increased from 100
to 512 to avoid out-of-bounds array access.
</pre>
</div>
</content>
</entry>
<entry>
<title>libdraw: Fix GUI programs on AIX (#398)</title>
<updated>2021-08-30T23:40:49+00:00</updated>
<author>
<name>Ben Huntsman</name>
<email>ben@huntsmans.net</email>
</author>
<published>2021-08-29T20:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=e9d8c4516847e3d8b36f384fb662b1a490f76f4e'/>
<id>e9d8c4516847e3d8b36f384fb662b1a490f76f4e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>devdraw, libdraw: fix memory leaks by freeing getns() malloced string (#431)</title>
<updated>2020-07-22T18:59:58+00:00</updated>
<author>
<name>Igor Böhm</name>
<email>boehm.igor@gmail.com</email>
</author>
<published>2020-07-22T18:59:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=afa34a73a91655f16d24abae491881ae45500d78'/>
<id>afa34a73a91655f16d24abae491881ae45500d78</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libdraw: handle larger number of subfonts</title>
<updated>2020-05-30T00:58:37+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2020-05-26T15:24:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=a6ad39aaaa36b8aadc5c35bfc803afbde32918c0'/>
<id>a6ad39aaaa36b8aadc5c35bfc803afbde32918c0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>devdraw, libdraw: handle keyboard runes &gt; U+FFFF</title>
<updated>2020-05-19T03:45:03+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2020-05-19T03:45:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=d25d0ca1a3682d97df67f62789767562aa5bf1b3'/>
<id>d25d0ca1a3682d97df67f62789767562aa5bf1b3</id>
<content type='text'>
Runes in Plan 9 were limited to the 16-bit BMP when I drew up
the RPC protocol between graphical programs and devdraw
a long time ago. Now that they can be 32-bit, use a 32-bit wire
encoding too. A new message number to avoid problems with
other clients (like 9fans.net/go).

Add keyboard shortcut alt : , for U+1F602, face with tears of joy,
to test that it all works.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Runes in Plan 9 were limited to the 16-bit BMP when I drew up
the RPC protocol between graphical programs and devdraw
a long time ago. Now that they can be 32-bit, use a 32-bit wire
encoding too. A new message number to avoid problems with
other clients (like 9fans.net/go).

Add keyboard shortcut alt : , for U+1F602, face with tears of joy,
to test that it all works.
</pre>
</div>
</content>
</entry>
<entry>
<title>libdraw: send hangup to process when window is lost</title>
<updated>2020-01-14T23:05:51+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2020-01-14T23:05:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=40d787ab1276f191bcf030748a954d6708d83228'/>
<id>40d787ab1276f191bcf030748a954d6708d83228</id>
<content type='text'>
This matches the Plan 9 behavior a bit better.

Fixes #30.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This matches the Plan 9 behavior a bit better.

Fixes #30.
</pre>
</div>
</content>
</entry>
<entry>
<title>libdraw: use proper pipe for default font data</title>
<updated>2020-01-14T18:32:17+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2020-01-14T18:18:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=4ae529dbfe8573ae105d0d66f7f453c4f850fa1f'/>
<id>4ae529dbfe8573ae105d0d66f7f453c4f850fa1f</id>
<content type='text'>
May fix a deadlock / missing font on OpenBSD.

Fixes #308.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
May fix a deadlock / missing font on OpenBSD.

Fixes #308.
</pre>
</div>
</content>
</entry>
<entry>
<title>libdraw: connect to devdraw via $wsysid when set</title>
<updated>2020-01-13T21:46:14+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@swtch.com</email>
</author>
<published>2020-01-11T10:52:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rctt.net/plan9port/commit/?id=dbf57689c45611b8da9e269c24e409ee33a877d5'/>
<id>dbf57689c45611b8da9e269c24e409ee33a877d5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
