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.
This commit is contained in:
parent
adb36de077
commit
17a92f3995
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue