aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/acme')
-rw-r--r--src/cmd/acme/dat.h4
-rw-r--r--src/cmd/acme/disk.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
index d0feb095..5c156eb6 100644
--- a/src/cmd/acme/dat.h
+++ b/src/cmd/acme/dat.h
@@ -69,7 +69,7 @@ struct Range
struct Block
{
- uint addr; /* disk address in bytes */
+ vlong addr; /* disk address in bytes */
union
{
uint n; /* number of used runes in block */
@@ -80,7 +80,7 @@ struct Block
struct Disk
{
int fd;
- uint addr; /* length of temp file */
+ vlong addr; /* length of temp file */
Block *free[Maxblock/Blockincr+1];
};
diff --git a/src/cmd/acme/disk.c b/src/cmd/acme/disk.c
index 857d9329..8d95fa1d 100644
--- a/src/cmd/acme/disk.c
+++ b/src/cmd/acme/disk.c
@@ -82,6 +82,9 @@ disknewblock(Disk *d, uint n)
b = blist;
blist = b->u.next;
b->addr = d->addr;
+ if(d->addr+size < d->addr){
+ error("temp file overflow");
+ }
d->addr += size;
}
b->u.n = n;