--- /n/sources/plan9/sys/src/9/port/netif.c Tue Jun 21 22:28:19 2011 +++ /sys/src/9/port/netif.c Tue May 31 00:00:00 2016 @@ -66,7 +66,7 @@ /* second level contains clone plus all the conversations */ t = NETTYPE(c->qid.path); - if(t == N2ndqid || t == Ncloneqid || t == Naddrqid){ + if(t == N2ndqid || t == Ncloneqid || t == Naddrqid || t == Nstatqid || t == Nifstatqid){ switch(i) { case DEVDOTDOT: q.type = QTDIR; @@ -378,8 +378,10 @@ free(dir); error(Eshortstat); } - if(!emptystr(dir[0].uid)) - strncpy(f->owner, dir[0].uid, KNAMELEN); + if(!emptystr(dir[0].uid)){ + strncpy(f->owner, dir[0].uid, KNAMELEN-1); + f->owner[KNAMELEN-1] = 0; + } if(dir[0].mode != ~0UL) f->mode = dir[0].mode; free(dir); @@ -475,7 +477,8 @@ return -1; } } - strncpy(p->owner, o, KNAMELEN); + strncpy(p->owner, o, KNAMELEN-1); + p->owner[KNAMELEN-1] = 0; p->mode = 0660; unlock(&netlock); return 0;