summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/common-utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index d57cd8a55fe..c37a876dfc6 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1500,6 +1500,12 @@ gf_string2percent_or_bytesize (const char *str,
return -1;
}
+ /* Error out if we cannot store the value in uint64 */
+ if (value > UINT64_MAX) {
+ errno = EOVERFLOW;
+ return -1;
+ }
+
*n = (uint64_t) value;
return 0;