Skip to content

Conversation

@levyfan
Copy link

@levyfan levyfan commented Jun 1, 2016

fix de-duplicate issue in ZUNIONTOP/ZUNIONREVTOP #8 #8

@levyfan
Copy link
Author

levyfan commented Jun 2, 2016

@dvirsky @itamarhaber please have a review

src/rxzsets.c Outdated

// de-duplicate
int ret = 0;
kh_put(32, h, RedisModule_StringPtrLen(entry->element, NULL), &ret);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be dangerous re NULL termination.
from client requests strigns are null terminated implicitly, but from RedisModule_Call responses they usually aren't.
You can strndup maybe and create a null terminated string if you can free it later.

@levyfan
Copy link
Author

levyfan commented Jun 3, 2016

@dvirsky Instead of copying string out, I write a hash function on RedisModuleString and put RedisModuleString into the hash set.

@levyfan
Copy link
Author

levyfan commented Jun 5, 2016

@dvirsky @itamarhaber please have a review

@dvirsky
Copy link

dvirsky commented Jun 5, 2016

@itamarhaber I'm jet lagged and tired, so... :)

@levyfan
Copy link
Author

levyfan commented Jun 30, 2016

ping @itamarhaber @dvirsky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants