]> wimlib.net Git - wimlib/blobdiff - src/registry.c
README.WINDOWS: describe 64-bit build by default
[wimlib] / src / registry.c
index 6b7f9815bce7a97b7385741934d83a3176e400a7..f7eca9ab1d26721afb60561e092e1111944086f4 100644 (file)
@@ -143,6 +143,7 @@ struct data_cell {
 
 /* Arbitrary limits for safety  */
 #define MAX_VALUES             65536
+#define MAX_VALUE_SIZE         1048576
 #define MAX_SUBKEYS            65536
 #define MAX_SUBKEY_LIST_LEVELS 5
 #define MAX_SUBKEY_LISTS       4096
@@ -532,7 +533,7 @@ retrieve_value(const struct regf *regf, const tchar *key_name,
        is_inline = (data_size & 0x80000000);
        data_size &= 0x7FFFFFFF;
 
-       if (data_size > 1048576)        /* Arbitrary limit */
+       if (data_size > MAX_VALUE_SIZE)
                return HIVE_CORRUPT;
 
        if (is_inline) {
@@ -680,12 +681,11 @@ append_subkey_name(const struct nk *sub_nk, void *_next_subkey_p)
                        subkey[i] = sub_nk->name[i];
                subkey[name_size] = '\0';
        } else {
-               size_t dummy;
                enum hive_status status;
 
                status = translate_wimlib_error(
                        utf16le_to_tstr((utf16lechar *)sub_nk->name,
-                                       name_size, &subkey, &dummy));
+                                       name_size, &subkey, NULL));
                if (status != HIVE_OK)
                        return status;
        }