From: Jiyoung Yun Date: Thu, 21 May 2015 08:03:05 +0000 (+0900) Subject: libstorage: Add memory size check routine X-Git-Tag: accepted/tizen/common/20150526.081221^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ed1220fc817b109368d1f587c75faa1d3057b46;p=platform%2Fcore%2Fsystem%2Flibstorage.git libstorage: Add memory size check routine If a memory size is zero, it does not try to divide by zero. Change-Id: Ieeff37b0d527f0edba7d06f54f4f31081632f9b9 Signed-off-by: Jiyoung Yun --- diff --git a/src/statvfs.c b/src/statvfs.c index ca2c62b..81d323f 100644 --- a/src/statvfs.c +++ b/src/statvfs.c @@ -250,7 +250,7 @@ API int storage_get_internal_memory_size(struct statvfs *buf) } ret = get_memory_size(MEMORY_STATUS_USR_PATH, &temp); - if (ret) { + if (ret || temp.f_bsize == 0) { _E("fail to get memory size"); return -errno; }