mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-09-06 03:51:27 +02:00
Increase the allowable node name length from 24 to 256.
Enable safe copying, no user induced buffer overflow.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user