Below is the list of changes that have just been committed into a local
5.0 repository of cps. When cps does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2071 05/10/18 05:04:09 petr@stripped +1 -0
Fix Bug #14103 IM tests fail on SCO
mysys/default.c
1.81 05/10/18 05:03:57 petr@stripped +32 -5
Reduce size of the stack arrays used to read options: use 1k buffer instead of 4k.
Issue a warning in case if the option was too long. This fixes IM crash on SCO, where
we have very small default stack size.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: petr
# Host: owlet.
# Root: /home/cps/mysql/trees/mysql-5.0
--- 1.80/mysys/default.c 2005-09-30 14:25:36 +04:00
+++ 1.81/mysys/default.c 2005-10-18 05:03:57 +04:00
@@ -575,15 +575,21 @@
const char *config_file,
int recursion_level)
{
- char name[FN_REFLEN + 10], buff[4096], curr_gr[4096], *ptr, *end, **tmp_ext;
- char *value, option[4096], tmp[FN_REFLEN];
+ char name[FN_REFLEN + 10], buff[1024], curr_gr[1024], *ptr, *end, **tmp_ext;
+ char *value, option[1024], tmp[FN_REFLEN];
static const char includedir_keyword[]= "includedir";
static const char include_keyword[]= "include";
const int max_recursion_level= 10;
FILE *fp;
- uint line=0;
- my_bool found_group=0;
+ uint line= 0;
+ my_bool found_group= 0;
uint i;
+ /*
+ With this var set to 1 we don't process result of fgets, until
+ the next newline occured. We need it to skip over the options, which
+ are longer then 1k.
+ */
+ uint skip_newline= 0;
MY_DIR *search_dir;
FILEINFO *search_file;
@@ -626,6 +632,27 @@
while (fgets(buff, sizeof(buff) - 1, fp))
{
line++;
+ /*
+ Check that the option wasn't truncated. We are safe here as
+ "\n" is the last newline char both on windows and unixes
+ */
+ if (buff[strlen(buff) - 1] != '\n') /* ignore options which are too long */
+ {
+ if (!skip_newline) /* we are at the start of very long option */
+ {
+ skip_newline= 1;
+ fprintf(stderr, "Warning: the option starting with '%s' is too long."
+ " Skipping the option.\n", buff);
+ }
+ continue;
+ }
+
+ if (skip_newline)
+ {
+ skip_newline= 0; /* reset the flag */
+ continue;
+ }
+
/* Ignore comment and empty lines */
for (ptr= buff; my_isspace(&my_charset_latin1, *ptr); ptr++)
{}
@@ -718,7 +745,7 @@
for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;/* Remove end space */
end[0]=0;
- strnmov(curr_gr, ptr, min((uint) (end-ptr)+1, 4096));
+ strnmov(curr_gr, ptr, min((uint) (end-ptr) + 1, 1024));
continue;
}
if (!found_group)
| Thread |
|---|
| • bk commit into 5.0 tree (petr:1.2071) BUG#14103 | Petr Chardin | 18 Oct |