chiark / gitweb /
efi: fix returned length of efi_get_variable()
[elogind.git] / src / shared / efivars.c
index d5cb88cff1504475ca3a1da9242ab25063a681eb..09af44a2fe6a6764d3b4417b6ff320c6fa5c3b27 100644 (file)
@@ -85,7 +85,7 @@ int efi_get_variable(sd_id128_t vendor, const char *name, uint32_t *attribute, v
         ((char*) r)[st.st_size - 4 + 1] = 0;
 
         *value = r;
-        *size = (size_t) st.st_size;
+        *size = (size_t) st.st_size - 4;
 
         if (attribute)
                 *attribute = a;