Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 654724 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-1 / +7 lines)
Line  Link Here
0
-- a/webserver/mongoose.c
0
++ b/webserver/mongoose.c
Lines 8353-8365 Link Here
8353
   */
8353
   */
8354
  if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
8354
  if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
8355
    /* File name is relative to the webserver root */
8355
    /* File name is relative to the webserver root */
8356
#pragma GCC diagnostic warning "-Wformat-truncation"
8356
    snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
8357
    snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
8358
#pragma GCC diagnostic error "-Wformat-truncation"
8357
  } else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
8359
  } else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
8358
    /*
8360
    /*
8359
     * File name is relative to the webserver working directory
8361
     * File name is relative to the webserver working directory
8360
     * or it is absolute system path
8362
     * or it is absolute system path
8361
     */
8363
     */
8364
#pragma GCC diagnostic warning "-Wformat-truncation"
8362
    snprintf(path, sizeof(path), "%s", file_name);
8365
    snprintf(path, sizeof(path), "%s", file_name);
8366
#pragma GCC diagnostic error "-Wformat-truncation"
8363
  } else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
8367
  } else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
8364
             sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
8368
             sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
8365
    /* File name is relative to the currect document */
8369
    /* File name is relative to the currect document */
Lines 8367-8373 Link Here
8367
    if ((p = strrchr(path, DIRSEP)) != NULL) {
8371
    if ((p = strrchr(path, DIRSEP)) != NULL) {
8368
      p[1] = '\0';
8372
      p[1] = '\0';
8369
    }
8373
    }
8374
#pragma GCC diagnostic warning "-Wformat-truncation"
8370
    snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name);
8375
    snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name);
8376
#pragma GCC diagnostic error "-Wformat-truncation"
8371
  } else {
8377
  } else {
8372
    mg_printf(nc, "Bad SSI #include: [%s]", tag);
8378
    mg_printf(nc, "Bad SSI #include: [%s]", tag);
8373
    return;
8379
    return;

Return to bug 654724