janitor duty (merges from 3.0) and cleanup compiler warning on SuSE 9 in the end...
[gd/samba/.git] / source3 / nsswitch / winbindd_group.c
index b31dc92b38c94154bf91cc43344d3abc816c6edc..4805e628dd800fc0c592eab48640df5b673cffd9 100644 (file)
@@ -1098,7 +1098,7 @@ enum winbindd_result winbindd_getusersids(struct winbindd_cli_state *state)
        enum winbindd_result result = WINBINDD_ERROR;
        unsigned int i;
        TALLOC_CTX *mem_ctx;
-       char *ret;
+       char *ret = NULL;
        uint32 num_groups;
        unsigned ofs, ret_size = 0;
 
@@ -1144,7 +1144,7 @@ enum winbindd_result winbindd_getusersids(struct winbindd_cli_state *state)
        ofs = 0;
        for (i = 0; i < num_groups; i++) {
                const char *s = sid_string_static(user_grpsids[i]);
-               safe_strcpy(ret + ofs, s, ret_size - ofs);
+               safe_strcpy(ret + ofs, s, ret_size - ofs - 1);
                ofs += strlen(ret+ofs) + 1;
        }