Commit a4bce77e authored by antirez's avatar antirez
Browse files

Don't assume no padding or specific ordering in moduleLoadQueueEntry structure.

We need to be free to shuffle fields or add more fields in a structure
without breaking code.

Related to issue #3293.
parent 9a02dac2
...@@ -154,10 +154,11 @@ void resetServerSaveParams(void) { ...@@ -154,10 +154,11 @@ void resetServerSaveParams(void) {
} }
void queueLoadModule(sds path, sds *argv, int argc) { void queueLoadModule(sds path, sds *argv, int argc) {
struct moduleLoadQueueEntry *loadmod =
zmalloc(sizeof(struct moduleLoadQueueEntry)+sizeof(robj*)*argc);
int i; int i;
struct moduleLoadQueueEntry *loadmod;
loadmod = zmalloc(sizeof(struct moduleLoadQueueEntry));
loadmod->argv = zmalloc(sizeof(robj*)*argc);
loadmod->path = sdsnew(path); loadmod->path = sdsnew(path);
loadmod->argc = argc; loadmod->argc = argc;
for (i = 0; i < argc; i++) { for (i = 0; i < argc; i++) {
......
...@@ -686,7 +686,7 @@ struct saveparam { ...@@ -686,7 +686,7 @@ struct saveparam {
struct moduleLoadQueueEntry { struct moduleLoadQueueEntry {
sds path; sds path;
int argc; int argc;
robj *argv[]; robj **argv;
}; };
struct sharedObjectsStruct { struct sharedObjectsStruct {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment