; diffy -c ../port/portdat.h
/n/dump/2012/0224/sys/src/9/port/portdat.h:701,707 - ../port/portdat.h:701,707
        char    *errstr;        /* reason we're unwinding the error stack, 
errbuf1 or 0 */
        char    errbuf0[ERRMAX];
        char    errbuf1[ERRMAX];
-       char    genbuf[128];    /* buffer used e.g. for last name element from 
namec */
+       char    genbuf[ERRMAX]; /* buffer used e.g. for last name element from 
namec */
        Chan    *slash;
        Chan    *dot;
  
; diffy -c ../port/devenv.c
/n/dump/2012/0224/sys/src/9/port/devenv.c:8,13 - ../port/devenv.c:8,14
  enum
  {
        Maxenvsize = 16300,
+       Maxename = ERRMAX-1,            /* sizeof(Proc->genbuf) */
  };
  
  static Egrp   *envgrp(Chan *c);
/n/dump/2012/0224/sys/src/9/port/devenv.c:146,151 - ../port/devenv.c:147,154
  
        if(c->qid.type != QTDIR)
                error(Eperm);
+       if(strlen(name) > Maxename)
+               error("name too long");
  
        omode = openmode(omode);
        eg = envgrp(c);

Reply via email to