--- /n/sources/plan9/sys/src/cmd/ssh2/netssh.c Thu Apr 19 10:50:04 2012 +++ /sys/src/cmd/ssh2/netssh.c Tue Sep 22 00:00:00 2026 @@ -1934,7 +1934,12 @@ p = path; n = 0; do { - if (ioread(io, fd, p, 1) < 0) { + if (n >= sizeof path - 1) { + sshlog(c, "ID string too long in ID exchange"); + close(fd); + goto err; + } + if (ioread(io, fd, p, 1) != 1) { *p = '\0'; sshlog(c, "short read after %d bytes " "in ID exchange: %s: %r\n", n, path);