[sheepdog] [PATCH v2] zookeeper: multi-sheep cluster in one zookeeper support

yuyanggg at gmail.com yuyanggg at gmail.com
Mon Mar 2 02:21:42 CET 2015


Yes ,we can. And your suggestion remind me, I'll check the other strcat .


On 2015年02月28日 16:44, Yu Yang wrote:
> char root[MAX_NODE_STR_LEN];
> + char conn[MAX_NODE_STR_LEN];
> + const char *p = strchr(hosts, '/');
> + int interval, max_retry, retry;
> + int i = 0;
> + strcpy(root, p);
> + while (hosts != p)
> + conn[i++] = *hosts++;
> + conn[i] = '\0';
 
Can we add bounds check here ? I hate to see silently buffer overflow,  even
in real world, it might not be a problem. If user can input more than 
256 characters,
strdup and strndup will work, returning NULL and crashing when accessing 
the first page
is still better than silently buffer overflow .
 
Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20150302/e5e07148/attachment-0003.html>


More information about the sheepdog mailing list