diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-02-28 16:48:42 +0100 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-02-28 16:48:42 +0100 |
| commit | 17a92f3995976b5d7618d1a2442e0028c1b192de (patch) | |
| tree | bb80be4a3d1482b48d1392b3e43f63d156ecf557 | |
| parent | adb36de077c9bcd99072e86c7f84bac46a58e326 (diff) | |
| download | plan9front-17a92f3995976b5d7618d1a2442e0028c1b192de.tar.xz | |
devproc: make sure writewatchpt() doesnt overflow the watchpoint array
the user buffer could be changed while we parse it resulting
in a different number of watchpoints than initially calculated.
so add a check to the parse loop so we wont overflow the
watchpoint array.
| -rw-r--r-- | sys/src/9/port/devproc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/port/devproc.c b/sys/src/9/port/devproc.c index b2509ddcb..4692eafda 100644 --- a/sys/src/9/port/devproc.c +++ b/sys/src/9/port/devproc.c @@ -812,7 +812,7 @@ writewatchpt(Proc *pr, char *buf, int nbuf, uvlong offset) } if(nwp0 > 0) memmove(wp, pr->watchpt, sizeof(Watchpt) * nwp0); - for(wq = wp + nwp0;;){ + for(wq = wp + nwp0; wq < wp + nwp0+nwp;){ q = memchr(p, '\n', e - p); if(q == nil) break; |
