From ecf2201df71a3e51b397036ce7dd0261c46d216c Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 13 Mar 2010 04:20:25 +1100 Subject: [PATCH] dont try to modify offset if size is 0 it will generate a division by zero fault and crash the thread --- libnfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfs.c b/libnfs.c index 3f60eff..915526a 100644 --- a/libnfs.c +++ b/libnfs.c @@ -831,7 +831,7 @@ nfsstat3 nfsio_read(struct nfsio *nfsio, const char *name, char *buf, uint64_t o goto finished; } - if (offset >= size) { + if (offset >= size && size > 0) { offset = offset % size; } if (offset+len >= size) { -- 2.34.1