Re: [9fans] Logitech T400 mouse with Plan9 and Plan9port Acme

2014-06-18 Thread Holger Sebert
Hi Ruslan, This is so awesome! I was first afraid of breaking something because I needed a non-trivial amount of force opening the T400 up. But the casing seems to be very flexible and durable -- a screw driver did the trick. My new 'lobotomized' T400 works like a charm. Thank you for this!!

Re: [9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread erik quanstrom
On Wed Jun 18 14:20:02 EDT 2014, quans...@quanstro.net wrote: > On Wed Jun 18 14:15:14 EDT 2014, p...@fb.com wrote: > > Well, hard to grep for '3' in a big codebase. They should have used UTFMAX > > in the first place. > > > > it's not hard. i did this once. i think i did something like this >

Re: [9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread erik quanstrom
On Wed Jun 18 14:15:14 EDT 2014, p...@fb.com wrote: > Well, hard to grep for '3' in a big codebase. They should have used UTFMAX in > the first place. > it's not hard. i did this once. i think i did something like this g 'char[]+[a-z]+\[(3|4|3\+1)\]' /sys/src - erik

Re: [9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread Yoann Padioleau
Well, hard to grep for '3' in a big codebase. They should have used UTFMAX in the first place. I see though that currently in libc.h I have enum { UTFmax = 4,/* maximum bytes per rune */ Runesync= 0x80, /* cannot represent part of a UTF seque

Re: [9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread erik quanstrom
On Wed Jun 18 13:36:09 EDT 2014, mirtchov...@gmail.com wrote: > used to be 3 :) > > "UTFmax, defined as 3 in , is the maximum number of bytes > required to represent a rune." which is exactly why this should have been caught. this one's my fault. - erik

Re: [9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread erik quanstrom
> But is the buf[3] enough? UTFMAX is 4 so we could possibly overflow no? > Shouldn't it be buf[UTFMAX] ? yes, it should. i thought i'd caught all of those. - erik

Re: [9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread andrey mirtchovski
used to be 3 :) "UTFmax, defined as 3 in , is the maximum number of bytes required to represent a rune." http://man.cat-v.org/plan_9/2/rune

[9fans] possible buffer overflow in devcons.c?

2014-06-18 Thread Yoann Padioleau
Hi, In devcons.c there is /* * Put character, possibly a rune, into read queue at interrupt time. * Called at interrupt time to process a character. */ int kbdputc(Queue*, int ch) { int i, n; char buf[3]; <- enough? Rune r; char *next; if(kbd.ir =

[9fans] Logitech T400 mouse with Plan9 and Plan9port Acme

2014-06-18 Thread Ruslan Khusnullin
I posted a question about the mouse in 2013: > From: Ruslan Khusnullin > Subject: Logitech T400 mouse with Plan9 and Plan9port Acme > Date: Mon, 25 Feb 2013 17:38:40 +0400 > > Considering how difficult it is to find a new usb mouse with 3 real > buttons I'm looking for workarounds. I have a Cont