Changeset 7289823 in code
- Timestamp:
- Mar 7, 2014, 3:42:03 PM (11 years ago)
- Branches:
- master
- Children:
- a76f866
- Parents:
- 8871953
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
dns.c
r8871953 r7289823 43 43 union { 44 44 struct sockaddr_storage req; 45 char rep[ MAXHOSTNAMELEN];45 char rep[NI_MAXHOST]; 46 46 } u; 47 47 }; … … 168 168 } 169 169 170 memcpy(is->host, q.u.rep, MAXHOSTNAMELEN); 171 is->host[sizeof is->host - 1] = '\0'; 170 if (verbose) 171 syslog(LOG_DEBUG, "icbd_dns: resolved %s to %s", 172 is->host, q.u.rep); 172 173 173 if (verbose) 174 syslog(LOG_DEBUG, "icbd_dns: resolved %s", is->host); 174 /* XXX */ 175 if (strcmp(q.u.rep, "localhost") == 0) 176 strlcpy(is->host, "unknown", ICB_MAXHOSTLEN); 177 else if (strlen(q.u.rep) < ICB_MAXHOSTLEN) 178 strlcpy(is->host, q.u.rep, ICB_MAXHOSTLEN); 175 179 } 176 180 -
icb.h
r8871953 r7289823 30 30 #define ICB_MAXPASSLEN 32 31 31 #define ICB_MAXTOPICLEN 160 32 #define ICB_MAXHOSTLEN 40 32 33 #define ICB_MTABLEN 50 /* XXX */ 33 34 … … 76 77 char nick[ICB_MAXNICKLEN]; 77 78 char client[ICB_MAXNICKLEN]; 78 char host[ MAXHOSTNAMELEN];79 char host[ICB_MAXHOSTLEN]; 79 80 char buffer[ICB_MSGSIZE]; 80 81 struct event ev;
Note:
See TracChangeset
for help on using the changeset viewer.