Projects
home:connyhald:branches:Kolab:3.3:Updates
cyrus-imapd
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 12
View file
ptloader-segfault.patch
Changed
@@ -1,6 +1,6 @@ --- a/ptclient/ldap.c +++ b/ptclient/ldap.c -@@ -630,59 +630,60 @@ static int ptsmodule_escape( +@@ -630,55 +630,46 @@ static int ptsmodule_escape( static int *ptsmodule_standard_root_dn(const char *domain, const char **result) { @@ -13,7 +13,7 @@ char *part; char *ptr; + char *dc=",dc="; -+ char *dn=NULL; ++ char *dn; + dn = xzmalloc(1024); + buf = xzmalloc(1024); + buf0 = '\0'; // (?) @@ -26,17 +26,16 @@ - dots++; - } - } -+ strncpy(dn, domain, strlen(domain)); - - /* Each dot is to be replaced with ',dc=' (length 4), so add - * length 3 for each of them. - */ +- +- /* Each dot is to be replaced with ',dc=' (length 4), so add +- * length 3 for each of them. +- */ - root_dn_len = strlen(domain) + (dots * 3); ++ strncpy(dn, domain, strlen(domain)); - buf = xmalloc(root_dn_len); -+ buf = xzmalloc(1024); - buf0 = '\0'; // (?) - /* AM: Above: Terminate the string by default, so strlen won't buffer-overflow later */ +- buf0 = '\0'; // (?) +- /* AM: Above: Terminate the string by default, so strlen won't buffer-overflow later */ /* AM: No need for another allocation/dup */ - part = strtok_r(domain, ".", &ptr); @@ -63,20 +62,12 @@ - memmove(buf, buf+1, strlen(buf)); + memmove(buf, buf+1, strlen(buf)); -+ strcat(buf,"\0"); *result = xstrdup(buf); free(buf); free(part); + free(dn); -+ /* free(ptr); - free(root_dn_len); */ syslog(LOG_DEBUG, "Root DN now %s", *result); - - return PTSM_OK; -+ - } - - static int ptsmodule_tokenize_domains( \ No newline at end of file
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.