Increase the allowable node name length from 24 to 256.
Enable safe copying, no user induced buffer overflow.
This commit is contained in:
parent
10756111bf
commit
b62bb20e6f
|
|
@ -184,7 +184,7 @@ typedef struct linked_lists_of_Bpoint{
|
|||
} BPOINT, *BPOINTPTR;
|
||||
|
||||
typedef struct linked_lists_of_nodeName{
|
||||
char id[24];
|
||||
char id[256];
|
||||
struct linked_lists_of_nodeName *left, *right;
|
||||
NODE *nd;
|
||||
} NDname, *NDnamePt;
|
||||
|
|
|
|||
|
|
@ -1934,7 +1934,8 @@ insert_ND(char* name, NDnamePt* ndn)
|
|||
memsaved(p);
|
||||
p->nd = NULL;
|
||||
p->right = p->left = NULL;
|
||||
strcpy(p->id, name);
|
||||
strncpy(p->id, name, 255);
|
||||
p->id[255] = '\0';
|
||||
return(p);
|
||||
}
|
||||
cmp = strcmp((*ndn)->id, name);
|
||||
|
|
|
|||
|
|
@ -1035,7 +1035,8 @@ insert_ND(char *name, NDnamePt *ndn)
|
|||
p = *ndn = TMALLOC(NDname, 1);
|
||||
p->nd = NULL;
|
||||
p->right = p->left = NULL;
|
||||
strcpy(p->id, name);
|
||||
strncpy(p->id, name, 255);
|
||||
p->id[255] = '\0';
|
||||
return(p);
|
||||
}
|
||||
cmp = strcmp((*ndn)->id, name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue