Browse Source

remove heap overflow ion tfree(path)

pre-master-46
h_vogt 17 years ago
parent
commit
fdb0e0bed7
  1. 1
      ChangeLog
  2. 2
      src/main.c

1
ChangeLog

@ -3,6 +3,7 @@
(755 instead of 644) (755 instead of 644)
* fteext.h spiceif.c options.c dotcards.c: .options NOACCT added * fteext.h spiceif.c options.c dotcards.c: .options NOACCT added
* /tests/.../*.cir .options noacct added (except BSIM3 files) * /tests/.../*.cir .options noacct added (except BSIM3 files)
* main.c:614 allow null terminator in string
2009-02-22 Dietmar Warning 2009-02-22 Dietmar Warning
* devices/adms/mextram: Update to release version 504.7 now with selfheating * devices/adms/mextram: Update to release version 504.7 now with selfheating

2
src/main.c

@ -611,7 +611,7 @@ read_initialisation_file(char * dir, char * name)
asprintf(&path, "%s" DIR_PATHSEP "%s", dir,name); asprintf(&path, "%s" DIR_PATHSEP "%s", dir,name);
if(path==NULL) return FALSE; /* memory allocation error */ if(path==NULL) return FALSE; /* memory allocation error */
#else /* ~ HAVE_ASPRINTF */ #else /* ~ HAVE_ASPRINTF */
path=(char*)tmalloc(1 + strlen(dir)+strlen(name));
path=(char*)tmalloc(2 + strlen(dir)+strlen(name));
if(path==NULL) return FALSE; /* memory allocation error */ if(path==NULL) return FALSE; /* memory allocation error */
sprintf(path,"%s" DIR_PATHSEP "%s",dir,name); sprintf(path,"%s" DIR_PATHSEP "%s",dir,name);
#endif /* HAVE_ASPRINTF */ #endif /* HAVE_ASPRINTF */

Loading…
Cancel
Save