| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent eb80be3 commit a87187b
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,17 @@ | |||
| 1 | + 2015-07-08 Ethan A Merritt <merritt@u.washington.edu> | ||
| 2 | + | ||
| 3 | + * term/estimate.trm: Initialization of enhanced text string buffer. | ||
| 4 | + Bug #1648 | ||
| 5 | + | ||
| 6 | + * src/set.c src/fit.c src/term.c src/parse.c term/cgm.trm term/gd.trm | ||
| 7 | + term/x11.trm: Fuzz-testing found a recurring pattern of fragile code: | ||
| 8 | + if (isstringvalue(c_token)) | ||
| 9 | + foo = try_to_get_string(); /* cannot fail */ | ||
| 10 | + Unfortunately it _can_ fail if an expression begins with a quoted string | ||
| 11 | + but is coerced into returning a numerical value. All of these sites | ||
| 12 | + require a specific for (foo != NULL). | ||
| 13 | + Bug #1649 | ||
| 14 | + | ||
| 1 | 15 | 2015-07-05 Ethan A Merritt <merritt@u.washington.edu> | |
| 2 | 16 | ||
| 3 | 17 | * src/wxterminal/gp_cairo.c (gp_cairo_set_dashtype): If the dashtype | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: fit.c,v 1.156 2015/04/24 22:07:39 sfeam Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: fit.c,v 1.157 2015/06/05 20:49:10 broeker Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* NOTICE: Change of Copyright Status | |
@@ -2354,11 +2354,11 @@ fit_command() | |||
| 2354 | 2354 | ||
| 2355 | 2355 | static char *viafile = NULL; | |
| 2356 | 2356 | free(viafile); /* Free previous name, if any */ | |
| 2357 | - viafile = try_to_get_string(); /* Cannot fail since isstringvalue succeeded */ | ||
| 2357 | + viafile = try_to_get_string(); | ||
| 2358 | + if (!viafile || !(f = loadpath_fopen(viafile, "r"))) | ||
| 2359 | + Eex2("could not read parameter-file \"%s\"", viafile); | ||
| 2358 | 2360 | if (!fit_suppress_log) | |
| 2359 | 2361 | fprintf(log_f, "fitted parameters and initial values from file: %s\n\n", viafile); | |
| 2360 | - if (!(f = loadpath_fopen(viafile, "r"))) | ||
| 2361 | - Eex2("could not read parameter-file \"%s\"", viafile); | ||
| 2362 | 2362 | ||
| 2363 | 2363 | /* get parameters and values out of file and ignore fixed ones */ | |
| 2364 | 2364 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: parse.c,v 1.92 2015/01/21 03:38:24 sfeam Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: parse.c,v 1.93 2015/06/03 22:55:46 sfeam Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - parse.c */ | |
@@ -200,10 +200,8 @@ string_or_express(struct at_type **atptr) | |||
| 200 | 200 | if (equals(c_token,"$")) | |
| 201 | 201 | return parse_datablock_name(); | |
| 202 | 202 | ||
| 203 | - if (isstring(c_token)) { | ||
| 204 | - str = try_to_get_string(); | ||
| 203 | + if (isstring(c_token) && (str = try_to_get_string())) | ||
| 205 | 204 | return str; | |
| 206 | - } | ||
| 207 | 205 | ||
| 208 | 206 | /* parse expression */ | |
| 209 | 207 | temp_at(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: set.c,v 1.489 2015/05/08 18:17:08 sfeam Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: set.c,v 1.490 2015/05/08 18:32:12 sfeam Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - set.c */ | |
@@ -1628,11 +1628,11 @@ set_encoding() | |||
| 1628 | 1628 | #endif | |
| 1629 | 1629 | } else { | |
| 1630 | 1630 | int temp = lookup_table(&set_encoding_tbl[0],c_token); | |
| 1631 | + char *senc; | ||
| 1631 | 1632 | ||
| 1632 | 1633 | /* allow string variables as parameter */ | |
| 1633 | - if ((temp == S_ENC_INVALID) && isstringvalue(c_token)) { | ||
| 1634 | + if ((temp == S_ENC_INVALID) && isstringvalue(c_token) && (senc = try_to_get_string())) { | ||
| 1634 | 1635 | int i; | |
| 1635 | - char *senc = try_to_get_string(); | ||
| 1636 | 1636 | for (i = 0; encoding_names[i] != NULL; i++) | |
| 1637 | 1637 | if (strcmp(encoding_names[i], senc) == 0) | |
| 1638 | 1638 | temp = i; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: term.c,v 1.314 2015/06/14 18:06:59 sfeam Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: term.c,v 1.315 2015/06/15 23:24:35 sfeam Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - term.c */ | |
@@ -1418,8 +1418,7 @@ set_term() | |||
| 1418 | 1418 | if (!END_OF_COMMAND) { | |
| 1419 | 1419 | input_name = gp_input_line + token[c_token].start_index; | |
| 1420 | 1420 | t = change_term(input_name, token[c_token].length); | |
| 1421 | - if (!t && isstringvalue(c_token)) { | ||
| 1422 | - input_name = try_to_get_string(); /* Cannot fail if isstringvalue succeeded */ | ||
| 1421 | + if (!t && isstringvalue(c_token) && (input_name = try_to_get_string())) { | ||
| 1423 | 1422 | t = change_term(input_name, strlen(input_name)); | |
| 1424 | 1423 | free(input_name); | |
| 1425 | 1424 | } else { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* Hey Emacs this is -*- C -*- | |
| 2 | - * $Id: cgm.trm,v 1.98 2012/11/25 22:01:22 sfeam Exp $ | ||
| 2 | + * $Id: cgm.trm,v 1.99 2012/12/21 23:05:17 sfeam Exp $ | ||
| 3 | 3 | */ | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - cgm.trm */ | |
@@ -457,12 +457,12 @@ CGM_options() | |||
| 457 | 457 | cgm_user_color_count++; | |
| 458 | 458 | ++c_token; | |
| 459 | 459 | } else { | |
| 460 | + char *s = NULL; | ||
| 460 | 461 | if (equals(c_token,"font")) | |
| 461 | 462 | c_token++; | |
| 462 | - if (isstringvalue(c_token)) { | ||
| 463 | + if (isstringvalue(c_token) && (s = try_to_get_string())) { | ||
| 463 | 464 | double relwidth; | |
| 464 | 465 | int font_index; | |
| 465 | - char *s = try_to_get_string(); | ||
| 466 | 466 | char *comma = strchr(s,','); | |
| 467 | 467 | if (comma && (1 == sscanf(comma+1,"%d",&cgm_fontsize))) | |
| 468 | 468 | *comma = '\0'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* Hello, Emacs, this is -*-C-*- | |
| 2 | - * $Id: gd.trm,v 1.181 2015/01/11 05:20:50 sfeam Exp $ | ||
| 2 | + * $Id: gd.trm,v 1.182 2015/02/18 20:37:39 sfeam Exp $ | ||
| 3 | 3 | */ | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT -- gd.trm */ | |
@@ -770,9 +770,9 @@ PNG_options() | |||
| 770 | 770 | } else { | |
| 771 | 771 | int brect[8]; | |
| 772 | 772 | char *err; | |
| 773 | + char *s; | ||
| 773 | 774 | ||
| 774 | - if (isstringvalue(c_token)) { | ||
| 775 | - char *s = try_to_get_string(); | ||
| 775 | + if (isstringvalue(c_token) && (s = try_to_get_string())) { | ||
| 776 | 776 | char *comma = strrchr(s,','); | |
| 777 | 777 | double fontsize; | |
| 778 | 778 | if (comma && (1 == sscanf(comma+1,"%lf",&fontsize))) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* Hello, Emacs, this is -*-C-*- | |
| 2 | - * $Id: x11.trm,v 1.224 2015/02/15 16:39:23 broeker Exp $ | ||
| 2 | + * $Id: x11.trm,v 1.225 2015/03/29 17:26:00 sfeam Exp $ | ||
| 3 | 3 | * | |
| 4 | 4 | */ | |
| 5 | 5 | ||
@@ -453,6 +453,7 @@ X11_options() | |||
| 453 | 453 | unsigned long existing_X11_window_id = 0; | |
| 454 | 454 | TBOOLEAN set_window = FALSE; | |
| 455 | 455 | #endif | |
| 456 | + char *s; | ||
| 456 | 457 | ||
| 457 | 458 | do_raise = ctrlq = UNSET; | |
| 458 | 459 | dashedlines = yes; | |
@@ -537,8 +538,7 @@ X11_options() | |||
| 537 | 538 | c_token++; | |
| 538 | 539 | if (END_OF_COMMAND) | |
| 539 | 540 | int_error(c_token, "expecting font name"); | |
| 540 | - if (isstringvalue(c_token)) { | ||
| 541 | - char *s = try_to_get_string(); | ||
| 541 | + if (isstringvalue(c_token) && (s = try_to_get_string())) { | ||
| 542 | 542 | strncpy(X11_default_font, s, sizeof(X11_default_font)); | |
| 543 | 543 | free(s); | |
| 544 | 544 | } else { | |
@@ -719,8 +719,7 @@ X11_options() | |||
| 719 | 719 | c_token = c_title_token; | |
| 720 | 720 | strncat(term_options, " title \"", sizeof(term_options)-strlen(term_options)-1); | |
| 721 | 721 | title = term_options + strlen(term_options); | |
| 722 | - if (isstringvalue(c_title_token)) { | ||
| 723 | - char *s = try_to_get_string(); | ||
| 722 | + if (isstringvalue(c_title_token) && (s = try_to_get_string())) { | ||
| 724 | 723 | strncat(term_options, s, sizeof(term_options)-strlen(term_options)-1); | |
| 725 | 724 | free(s); | |
| 726 | 725 | } else | |
| Back | FazBrowse Home | New Git URL |
0 commit comments