5i ki qi vi: avoid buffer overflow in command read loop

front
cinap_lenrek 2018-09-29 13:58:08 +02:00
parent e876447b75
commit bdcef9d692
4 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);