5i ki qi vi: avoid buffer overflow in command read loop
This commit is contained in:
parent
e876447b75
commit
bdcef9d692
4 changed files with 4 additions and 4 deletions
|
@ -571,7 +571,7 @@ cmd(void)
|
|||
Bflush(bioout);
|
||||
p = buf;
|
||||
n = 0;
|
||||
for(;;) {
|
||||
while(n < sizeof(buf)) {
|
||||
i = Bgetc(bin);
|
||||
if(i < 0)
|
||||
exits(0);
|
||||
|
|
|
@ -568,7 +568,7 @@ cmd(void)
|
|||
Bflush(bioout);
|
||||
p = buf;
|
||||
n = 0;
|
||||
for(;;) {
|
||||
while(n < sizeof(buf)) {
|
||||
i = Bgetc(bin);
|
||||
if(i < 0)
|
||||
exits(0);
|
||||
|
|
|
@ -580,7 +580,7 @@ cmd(void)
|
|||
Bflush(bioout);
|
||||
p = buf;
|
||||
n = 0;
|
||||
for(;;) {
|
||||
while(n < sizeof(buf)) {
|
||||
i = Bgetc(bin);
|
||||
if(i < 0)
|
||||
exits(0);
|
||||
|
|
|
@ -585,7 +585,7 @@ cmd(void)
|
|||
Bflush(bioout);
|
||||
p = buf;
|
||||
n = 0;
|
||||
for(;;) {
|
||||
while(n < sizeof(buf)) {
|
||||
i = Bgetc(bin);
|
||||
if(i < 0)
|
||||
exits(0);
|
||||
|
|
Loading…
Reference in a new issue