URI: 
       tlibventi: fix segfault in vtreadpacket when not connected - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 73392c2c7cc2e74759480a37e345366dfa265926
   DIR parent ca81de0ae174e737cf3594787fa885e51d6e9d1d
  HTML Author: David du Colombier <0intro@gmail.com>
       Date:   Mon, 12 Dec 2011 16:44:50 -0500
       
       libventi: fix segfault in vtreadpacket when not connected
       
       This problem happens especially in fossil/view when vtread
       can be called even if not connected to venti.
       
       The old libventi handle this case properly in the function vtRPC, which is called by vtReadPacket (client.c).
       
       R=rsc
       CC=plan9port.codebot
       http://codereview.appspot.com/5484044
       
       Diffstat:
         M src/libventi/client.c               |       5 +++++
       
       1 file changed, 5 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/src/libventi/client.c b/src/libventi/client.c
       t@@ -65,6 +65,11 @@ vtreadpacket(VtConn *z, uchar score[VtScoreSize], uint type, int n)
                if(memcmp(score, vtzeroscore, VtScoreSize) == 0)
                        return packetalloc();
        
       +        if(z == nil){
       +                werrstr("not connected");
       +                return nil;
       +        }
       +
                if(z->version[1] == '2' && n >= (1<<16)) {
                        werrstr("read count too large for protocol");
                        return nil;