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

Collapse All | Expand All

(-)subversion/libsvn_ra_serf/util.c (+30 lines)
Lines 2694-2700 Link Here
2694
#endif
2694
#endif
2695
}
2695
}
2696
2696
2697
#ifdef EXPAT_HAS_STOPPARSER
2698
static void
2699
expat_entity_declaration(void *userData,
2700
                         const XML_Char *entityName,
2701
                         int is_parameter_entity,
2702
                         const XML_Char *value,
2703
                         int value_length,
2704
                         const XML_Char *base,
2705
                         const XML_Char *systemId,
2706
                         const XML_Char *publicId,
2707
                         const XML_Char *notationName)
2708
{
2709
  struct expat_ctx_t *ectx = userData;
2697
2710
2711
  /* Stop the parser if an entity declaration is hit. */
2712
  XML_StopParser(ectx->parser, 0 /* resumable */);
2713
}
2714
#else
2715
/* A noop default_handler. */
2716
static void
2717
expat_default_handler(void *userData, const XML_Char *s, int len)
2718
{
2719
}
2720
#endif
2721
2698
/* Implements svn_ra_serf__response_handler_t */
2722
/* Implements svn_ra_serf__response_handler_t */
2699
static svn_error_t *
2723
static svn_error_t *
2700
expat_response_handler(serf_request_t *request,
2724
expat_response_handler(serf_request_t *request,
Lines 2712-2717 Link Here
2712
      XML_SetUserData(ectx->parser, ectx);
2736
      XML_SetUserData(ectx->parser, ectx);
2713
      XML_SetElementHandler(ectx->parser, expat_start, expat_end);
2737
      XML_SetElementHandler(ectx->parser, expat_start, expat_end);
2714
      XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
2738
      XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
2739
2740
#ifdef EXPAT_HAS_STOPPARSER
2741
      XML_SetEntityDeclHandler(ectx->parser, expat_entity_declaration);
2742
#else
2743
      XML_SetDefaultHandler(ectx->parser, expat_default_handler);
2744
#endif
2715
    }
2745
    }
2716
2746
2717
  /* ### TODO: sline.code < 200 should really be handled by the core */
2747
  /* ### TODO: sline.code < 200 should really be handled by the core */
(-)subversion/libsvn_subr/xml.c (+39 lines)
Lines 259-264 Link Here
259
}
259
}
260
260
261
261
262
#ifndef XML_VERSION_AT_LEAST
263
#define XML_VERSION_AT_LEAST(major,minor,patch)                  \
264
(((major) < XML_MAJOR_VERSION)                                       \
265
 || ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION)    \
266
 || ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \
267
     (patch) <= XML_MICRO_VERSION))
268
#endif /* XML_VERSION_AT_LEAST */
269
262
const char *
270
const char *
263
svn_xml_fuzzy_escape(const char *string, apr_pool_t *pool)
271
svn_xml_fuzzy_escape(const char *string, apr_pool_t *pool)
264
{
272
{
Lines 338-343 Link Here
338
  (*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len);
346
  (*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len);
339
}
347
}
340
348
349
#if XML_VERSION_AT_LEAST(1, 95, 8)
350
static void expat_entity_declaration(void *userData,
351
                                     const XML_Char *entityName,
352
                                     int is_parameter_entity,
353
                                     const XML_Char *value,
354
                                     int value_length,
355
                                     const XML_Char *base,
356
                                     const XML_Char *systemId,
357
                                     const XML_Char *publicId,
358
                                     const XML_Char *notationName)
359
{
360
  svn_xml_parser_t *svn_parser = userData;
361
362
  /* Stop the parser if an entity declaration is hit. */
363
  XML_StopParser(svn_parser->parser, 0 /* resumable */);
364
}
365
#else
366
/* A noop default_handler. */
367
static void expat_default_handler(void *userData, const XML_Char *s, int len)
368
{
369
}
370
#endif
341
371
342
/*** Making a parser. ***/
372
/*** Making a parser. ***/
343
373
Lines 359-364 Link Here
359
  XML_SetCharacterDataHandler(parser,
389
  XML_SetCharacterDataHandler(parser,
360
                              data_handler ? expat_data_handler : NULL);
390
                              data_handler ? expat_data_handler : NULL);
361
391
392
#if XML_VERSION_AT_LEAST(1, 95, 8)
393
  XML_SetEntityDeclHandler(parser, expat_entity_declaration);
394
#else
395
  XML_SetDefaultHandler(parser, expat_default_handler);
396
#endif
397
362
  /* ### we probably don't want this pool; or at least we should pass it
398
  /* ### we probably don't want this pool; or at least we should pass it
363
     ### to the callbacks and clear it periodically.  */
399
     ### to the callbacks and clear it periodically.  */
364
  subpool = svn_pool_create(pool);
400
  subpool = svn_pool_create(pool);
Lines 440-445 Link Here
440
  /* This will cause the current XML_Parse() call to finish quickly! */
476
  /* This will cause the current XML_Parse() call to finish quickly! */
441
  XML_SetElementHandler(svn_parser->parser, NULL, NULL);
477
  XML_SetElementHandler(svn_parser->parser, NULL, NULL);
442
  XML_SetCharacterDataHandler(svn_parser->parser, NULL);
478
  XML_SetCharacterDataHandler(svn_parser->parser, NULL);
479
#if XML_VERSION_AT_LEAST(1, 95, 8)
480
  XML_SetEntityDeclHandler(svn_parser->parser, NULL);
481
#endif
443
482
444
  /* Once outside of XML_Parse(), the existence of this field will
483
  /* Once outside of XML_Parse(), the existence of this field will
445
     cause svn_delta_parse()'s main read-loop to return error. */
484
     cause svn_delta_parse()'s main read-loop to return error. */
(-)tools/server-side/mod_dontdothat/mod_dontdothat.c (+39 lines)
Lines 42-47 Link Here
42
42
43
module AP_MODULE_DECLARE_DATA dontdothat_module;
43
module AP_MODULE_DECLARE_DATA dontdothat_module;
44
44
45
#ifndef XML_VERSION_AT_LEAST
46
#define XML_VERSION_AT_LEAST(major,minor,patch)                  \
47
(((major) < XML_MAJOR_VERSION)                                       \
48
 || ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION)    \
49
 || ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \
50
     (patch) <= XML_MICRO_VERSION))
51
#endif /* XML_VERSION_AT_LEAST */
52
45
typedef struct dontdothat_config_rec {
53
typedef struct dontdothat_config_rec {
46
  const char *config_file;
54
  const char *config_file;
47
  const char *base_path;
55
  const char *base_path;
Lines 551-556 Link Here
551
    }
559
    }
552
}
560
}
553
561
562
#if XML_VERSION_AT_LEAST(1, 95, 8)
563
static void
564
expat_entity_declaration(void *userData,
565
                         const XML_Char *entityName,
566
                         int is_parameter_entity,
567
                         const XML_Char *value,
568
                         int value_length,
569
                         const XML_Char *base,
570
                         const XML_Char *systemId,
571
                         const XML_Char *publicId,
572
                         const XML_Char *notationName)
573
{
574
  dontdothat_filter_ctx *ctx = userData;
575
576
  /* Stop the parser if an entity declaration is hit. */
577
  XML_StopParser(ctx->xmlp, 0 /* resumable */);
578
}
579
#else
580
/* A noop default_handler. */
581
static void
582
expat_default_handler(void *userData, const XML_Char *s, int len)
583
{
584
}
585
#endif
586
554
static svn_boolean_t
587
static svn_boolean_t
555
is_valid_wildcard(const char *wc)
588
is_valid_wildcard(const char *wc)
556
{
589
{
Lines 696-701 Link Here
696
      XML_SetElementHandler(ctx->xmlp, start_element, end_element);
729
      XML_SetElementHandler(ctx->xmlp, start_element, end_element);
697
      XML_SetCharacterDataHandler(ctx->xmlp, cdata);
730
      XML_SetCharacterDataHandler(ctx->xmlp, cdata);
698
731
732
#if XML_VERSION_AT_LEAST(1, 95, 8)
733
      XML_SetEntityDeclHandler(ctx->xmlp, expat_entity_declaration);
734
#else
735
      XML_SetDefaultHandler(ctx->xmlp, expat_default_handler);
736
#endif
737
699
      ap_add_input_filter("DONTDOTHAT_FILTER", ctx, r, r->connection);
738
      ap_add_input_filter("DONTDOTHAT_FILTER", ctx, r, r->connection);
700
    }
739
    }
701
}
740
}

Return to bug 600468