Skip to contentSkip to conversation

linux-user: don't zero a buffer twice

PATCH New Paul Bolle 1 participant 1 message Oct 2, 2009

lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

PATCH 1/1 linux-user: don't zero a buffer twice

prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in main() and hasn't been touched since so that is not necessary.

---
Just a minor issue that I noticed while reading the code for some other reason.

bsd-user/bsdload.c could need a similar patch. I haven't looked at that yet.

 linux-user/linuxload.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
linux-user/linuxload.c +0 -1
index 4091bdc..2d778a2 100644
@@ -96,7 +96,6 @@ static int prepare_binprm(struct linux_binprm *bprm)
 	}
     }
 
-    memset(bprm->buf, 0, sizeof(bprm->buf));
     retval = lseek(bprm->fd, 0L, SEEK_SET);
     if(retval >= 0) {
         retval = read(bprm->fd, bprm->buf, 128);
Signature · 1 line
1.6.5.rc2