diff options
| author | Russ Cox <rsc@swtch.com> | 2011-01-02 17:59:57 -0500 | 
|---|---|---|
| committer | Russ Cox <rsc@swtch.com> | 2011-01-02 17:59:57 -0500 | 
| commit | e92fd6142de05627096a1e831140e5bd355e45be (patch) | |
| tree | 201d63b061898deaed0736488ac7334246da6c8e | |
| parent | 2ea6c764c34d3025b5f3121a0919fda7d1eb9b01 (diff) | |
| download | xv6-labs-e92fd6142de05627096a1e831140e5bd355e45be.tar.gz xv6-labs-e92fd6142de05627096a1e831140e5bd355e45be.tar.bz2 xv6-labs-e92fd6142de05627096a1e831140e5bd355e45be.zip | |
mkfs: avoid out of bounds access to sb in wsect
| -rw-r--r-- | mkfs.c | 4 | 
1 files changed, 3 insertions, 1 deletions
| @@ -90,7 +90,9 @@ main(int argc, char *argv[])    for(i = 0; i < nblocks + usedblocks; i++)      wsect(i, zeroes); -  wsect(1, &sb); +  memset(buf, 0, sizeof(buf)); +  memmove(buf, &sb, sizeof(sb)); +  wsect(1, buf);    rootino = ialloc(T_DIR);    assert(rootino == ROOTINO); | 
