mirror of
https://github.com/bklang/ldap2dns.git
synced 2025-10-29 06:54:16 -04:00
Make sure we have room to store long domain names (such as IPv6 reverse DNS entries)
git-svn-id: https://svn.alkaloid.net/gpl/ldap2dns/trunk@520 06cd67b6-e706-0410-b29e-9de616bca6e9
This commit is contained in:
10
ldap2dns.c
10
ldap2dns.c
@@ -25,6 +25,7 @@
|
|||||||
#define MAXHOSTS 10
|
#define MAXHOSTS 10
|
||||||
#define DEF_SEARCHTIMEOUT 40
|
#define DEF_SEARCHTIMEOUT 40
|
||||||
#define DEF_RECLIMIT LDAP_NO_LIMIT
|
#define DEF_RECLIMIT LDAP_NO_LIMIT
|
||||||
|
#define MAX_DOMAIN_LEN 256
|
||||||
|
|
||||||
static char tinydns_textfile[256];
|
static char tinydns_textfile[256];
|
||||||
static char tinydns_texttemp[256];
|
static char tinydns_texttemp[256];
|
||||||
@@ -84,7 +85,7 @@ static struct
|
|||||||
struct resourcerecord
|
struct resourcerecord
|
||||||
{
|
{
|
||||||
char cn[64];
|
char cn[64];
|
||||||
char dnsdomainname[64];
|
char dnsdomainname[MAX_DOMAIN_LEN];
|
||||||
char class[16];
|
char class[16];
|
||||||
char type[16];
|
char type[16];
|
||||||
char ipaddr[256][80];
|
char ipaddr[256][80];
|
||||||
@@ -492,9 +493,12 @@ static int parse_options()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int expand_domainname(char target[64], const char* source, int slen)
|
static int expand_domainname(char target[MAX_DOMAIN_LEN], const char* source, int slen)
|
||||||
{
|
{
|
||||||
if (slen>64)
|
int tlen;
|
||||||
|
tlen = strlen(zone.domainname);
|
||||||
|
|
||||||
|
if ((slen + tlen) > MAX_DOMAIN_LEN)
|
||||||
return 0;
|
return 0;
|
||||||
if (source[slen-1]=='.') {
|
if (source[slen-1]=='.') {
|
||||||
strncpy(target, source, slen-1);
|
strncpy(target, source, slen-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user