Skip to content

Commit 82285f9

Browse files
fix statfs divide-by-zero when blksize is 0
On macOS, sshfs.blksize is set to 0. The statfs fallback path (used when the server lacks the statvfs extension) divides by f_frsize, which inherits that zero. Use 4096 as the default.
1 parent d749988 commit 82285f9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sshfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3382,7 +3382,7 @@ static int sshfs_statfs(const char *path, struct statvfs *buf)
33823382
return sshfs_ext_statvfs(path, buf);
33833383

33843384
buf->f_namemax = 255;
3385-
buf->f_bsize = sshfs.blksize;
3385+
buf->f_bsize = sshfs.blksize ? sshfs.blksize : 4096;
33863386
/*
33873387
* df seems to use f_bsize instead of f_frsize, so make them
33883388
* the same

0 commit comments

Comments
 (0)