mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-19 01:51:22 +00:00
* GSWAdaptors/common/GSWTemplates.c (GSWTemplate_GetTemplate):
Don't call strlen(0) as that may segfault. Reported by Matt Rice <ratmice@yahoo.com>. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18925 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
988d241ad3
commit
c1de12d63b
2 changed files with 18 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-03-26 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* GSWAdaptors/common/GSWTemplates.c (GSWTemplate_GetTemplate):
|
||||
Don't call strlen(0) as that may segfault. Reported by
|
||||
Matt Rice <ratmice@yahoo.com>.
|
||||
|
||||
2004-03-26 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
* GSWeb.framework/GSWAction.m/.h:
|
||||
o added -isActionNamed:
|
||||
|
|
|
@ -142,11 +142,18 @@ GSWTemplate_GetTemplate(BOOL p_fHTML,
|
|||
{
|
||||
FILE *fd=NULL;
|
||||
GSWConfig *gswConfig=GSWConfig_GetConfig();
|
||||
int applen=strlen(pApp->pszAdaptorTemplatesPath)+
|
||||
strlen(p_pszTemplateName);
|
||||
int globallen=strlen(gswConfig->pszAdaptorTemplatesPath)+
|
||||
strlen(p_pszTemplateName);
|
||||
int maxlen=(applen > globallen ? applen : globallen)+20;
|
||||
int applen = 0;
|
||||
int globallen = 0;
|
||||
int maxlen = 0;
|
||||
|
||||
applen = strlen(pApp->pszAdaptorTemplatesPath)
|
||||
+ strlen(p_pszTemplateName);
|
||||
|
||||
if (gswConfig->pszAdaptorTemplatesPath)
|
||||
globallen = strlen(gswConfig->pszAdaptorTemplatesPath)
|
||||
+ strlen(p_pszTemplateName);
|
||||
|
||||
maxlen = (applen > globallen ? applen : globallen) + 20;
|
||||
{
|
||||
char *pathName=malloc(maxlen);
|
||||
memset(pathName,0,maxlen);
|
||||
|
|
Loading…
Reference in a new issue