diff options
author | Andreas Schneider <asn@samba.org> | 2013-02-25 14:58:45 +0100 |
---|---|---|
committer | David Disseldorp <ddiss@suse.de> | 2013-03-05 23:29:58 +0100 |
commit | 1e4f4f6d921961c02398e51b97c6ff0c0bdf561d (patch) | |
tree | 079051d676f0b1479dafecfff9f4975ed39dba2f /source4/client | |
parent | 69f22e17d7cfe305de757f613c18cb0a2c303756 (diff) | |
download | samba-1e4f4f6d921961c02398e51b97c6ff0c0bdf561d.tar.gz samba-1e4f4f6d921961c02398e51b97c6ff0c0bdf561d.tar.bz2 samba-1e4f4f6d921961c02398e51b97c6ff0c0bdf561d.zip |
s4-client: Make sure entry is a valid string.
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/client.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/client/client.c b/source4/client/client.c index 43b0903cdc..66c21dfc54 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -454,7 +454,13 @@ static void adjust_do_list_queue(void) static void add_to_do_list_queue(const char* entry) { char *dlq; - long new_end = do_list_queue_end + ((long)strlen(entry)) + 1; + long new_end; + + if (entry == NULL) { + entry = ""; + } + + new_end = do_list_queue_end + ((long)strlen(entry)) + 1; while (new_end > do_list_queue_size) { do_list_queue_size *= 2; @@ -475,7 +481,7 @@ static void add_to_do_list_queue(const char* entry) } if (do_list_queue) { - strlcpy(do_list_queue + do_list_queue_end, entry ? entry : "", + strlcpy(do_list_queue + do_list_queue_end, entry, do_list_queue_size - do_list_queue_end); do_list_queue_end = new_end; DEBUG(4,("added %s to do_list_queue (start=%d, end=%d)\n", |