check for available space in GetName
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@253 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -574,7 +574,7 @@ ArrayToList(register Term *tp, int nof)
|
||||
}
|
||||
|
||||
int
|
||||
GetName(char *s, Term t)
|
||||
GetName(char *s, UInt max, Term t)
|
||||
{
|
||||
register Term Head;
|
||||
register Int i;
|
||||
@@ -590,6 +590,9 @@ GetName(char *s, Term t)
|
||||
return (FALSE);
|
||||
*s++ = i;
|
||||
t = TailOfTerm(t);
|
||||
if (--max == 0) {
|
||||
Error(FATAL_ERROR,t,"not enough space for GetName");
|
||||
}
|
||||
}
|
||||
*s = '\0';
|
||||
return (TRUE);
|
||||
|
Reference in New Issue
Block a user