38 lines
976 B
Diff
38 lines
976 B
Diff
From 5de18b3764e86414325bbfdb6dc297462598072f Mon Sep 17 00:00:00 2001
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
Date: Sun, 26 Aug 2018 20:46:52 +0100
|
|
Subject: [PATCH 2/2] memory: Fix parsing of size= parameter on 32 bit
|
|
platforms.
|
|
|
|
---
|
|
plugins/memory/memory.c | 11 ++---------
|
|
1 file changed, 2 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/plugins/memory/memory.c b/plugins/memory/memory.c
|
|
index 0b7fced..f175792 100644
|
|
--- a/plugins/memory/memory.c
|
|
+++ b/plugins/memory/memory.c
|
|
@@ -272,17 +272,10 @@ memory_unload (void)
|
|
static int
|
|
memory_config (const char *key, const char *value)
|
|
{
|
|
- int64_t r;
|
|
-
|
|
if (strcmp (key, "size") == 0) {
|
|
- r = nbdkit_parse_size (value);
|
|
- if (r == -1)
|
|
+ size = nbdkit_parse_size (value);
|
|
+ if (size == -1)
|
|
return -1;
|
|
- if (r > SIZE_MAX) {
|
|
- nbdkit_error ("size > SIZE_MAX");
|
|
- return -1;
|
|
- }
|
|
- size = (ssize_t) r;
|
|
}
|
|
else {
|
|
nbdkit_error ("unknown parameter '%s'", key);
|
|
--
|
|
2.18.0
|
|
|