I like this change a little better. It leaves the buffer null-terminated if at all possible.
Mark, can you check this on the system that was causing problem and see if it fixes things?
diff -u macCore.c.orig macCore.c
--- macCore.c.orig 2010-03-31 08:31:20.000000000 -0700
+++ macCore.c 2010-03-31 08:33:51.000000000 -0700
@@ -697,6 +697,10 @@
printf( "trans-> entry = %p, level = %d, maxlen = %u, discard = %s, "
"rawval = %s\n", entry, level, (unsigned int)(valend - *value), discard ? "T" : "F", *rawval );
+ /* Don't write past end of buffer */
+ if (valend == *value) { entry->error = TRUE; return; }
+ if (--valend == *value) { *valend = '\0'; entry->error = TRUE; return; }
+
/* initially not in quotes */
quote = 0;
--
Eric Norum
[email protected]
- Replies:
- Re: Bug in macLib Ralph Lange
- References:
- Bug in macLib Mark Rivers
- Re: Bug in macLib Andrew Johnson
- Re: Bug in macLib Eric Norum
- RE: Bug in macLib Mark Rivers
- Navigate by Date:
- Prev:
Re: Bug in macLib Eric Norum
- Next:
Re: Bug in macLib Ralph Lange
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
- Navigate by Thread:
- Prev:
RE: Bug in macLib Mark Rivers
- Next:
Re: Bug in macLib Ralph Lange
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
<2010>
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
|