diff options
Diffstat (limited to 'sbin/fsck/pass1.c')
-rw-r--r-- | sbin/fsck/pass1.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/fsck/pass1.c b/sbin/fsck/pass1.c index a3ab2f9842cd..fc46eb0323e6 100644 --- a/sbin/fsck/pass1.c +++ b/sbin/fsck/pass1.c @@ -95,7 +95,7 @@ checkinode(inumber, idesc) struct zlncnt *zlnp; int ndb, j; mode_t mode; - char symbuf[MAXSYMLINKLEN]; + char *symbuf; dp = getnextinode(inumber); mode = dp->di_mode & IFMT; @@ -141,9 +141,10 @@ checkinode(inumber, idesc) if (doinglevel2 && dp->di_size > 0 && dp->di_size < MAXSYMLINKLEN && dp->di_blocks != 0) { + symbuf = alloca(secsize); if (bread(fsreadfd, symbuf, fsbtodb(&sblock, dp->di_db[0]), - (long)dp->di_size) != 0) + (long)secsize) != 0) errexit("cannot read symlink"); if (debug) { symbuf[dp->di_size] = 0; |