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/xml.c (+30 lines)
Lines 988-994 Link Here
988
#endif
988
#endif
989
}
989
}
990
990
991
#if XML_VERSION_AT_LEAST(1, 95, 8)
992
static void
993
expat_entity_declaration(void *userData,
994
                         const XML_Char *entityName,
995
                         int is_parameter_entity,
996
                         const XML_Char *value,
997
                         int value_length,
998
                         const XML_Char *base,
999
                         const XML_Char *systemId,
1000
                         const XML_Char *publicId,
1001
                         const XML_Char *notationName)
1002
{
1003
  struct expat_ctx_t *ectx = userData;
991
1004
1005
  /* Stop the parser if an entity declaration is hit. */
1006
  XML_StopParser(ectx->parser, 0 /* resumable */);
1007
}
1008
#else
1009
/* A noop default_handler. */
1010
static void
1011
expat_default_handler(void *userData, const XML_Char *s, int len)
1012
{
1013
}
1014
#endif
1015
992
/* Implements svn_ra_serf__response_handler_t */
1016
/* Implements svn_ra_serf__response_handler_t */
993
static svn_error_t *
1017
static svn_error_t *
994
expat_response_handler(serf_request_t *request,
1018
expat_response_handler(serf_request_t *request,
Lines 1042-1047 Link Here
1042
      XML_SetUserData(ectx->parser, ectx);
1066
      XML_SetUserData(ectx->parser, ectx);
1043
      XML_SetElementHandler(ectx->parser, expat_start, expat_end);
1067
      XML_SetElementHandler(ectx->parser, expat_start, expat_end);
1044
      XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
1068
      XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
1069
1070
#if XML_VERSION_AT_LEAST(1, 95, 8)
1071
      XML_SetEntityDeclHandler(ectx->parser, expat_entity_declaration);
1072
#else
1073
      XML_SetDefaultHandler(ectx->parser, expat_default_handler);
1074
#endif
1045
    }
1075
    }
1046
1076
1047
  while (1)
1077
  while (1)
(-)subversion/libsvn_subr/xml.c (+39 lines)
Lines 46-51 Link Here
46
#error Expat is unusable -- it has been compiled for wide characters
46
#error Expat is unusable -- it has been compiled for wide characters
47
#endif
47
#endif
48
48
49
#ifndef XML_VERSION_AT_LEAST
50
#define XML_VERSION_AT_LEAST(major,minor,patch)                  \
51
(((major) < XML_MAJOR_VERSION)                                       \
52
 || ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION)    \
53
 || ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \
54
     (patch) <= XML_MICRO_VERSION))
55
#endif /* XML_VERSION_AT_LEAST */
56
49
const char *
57
const char *
50
svn_xml__compiled_version(void)
58
svn_xml__compiled_version(void)
51
{
59
{
Lines 361-366 Link Here
361
  (*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len);
369
  (*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len);
362
}
370
}
363
371
372
#if XML_VERSION_AT_LEAST(1, 95, 8)
373
static void expat_entity_declaration(void *userData,
374
                                     const XML_Char *entityName,
375
                                     int is_parameter_entity,
376
                                     const XML_Char *value,
377
                                     int value_length,
378
                                     const XML_Char *base,
379
                                     const XML_Char *systemId,
380
                                     const XML_Char *publicId,
381
                                     const XML_Char *notationName)
382
{
383
  svn_xml_parser_t *svn_parser = userData;
384
385
  /* Stop the parser if an entity declaration is hit. */
386
  XML_StopParser(svn_parser->parser, 0 /* resumable */);
387
}
388
#else
389
/* A noop default_handler. */
390
static void expat_default_handler(void *userData, const XML_Char *s, int len)
391
{
392
}
393
#endif
364
394
365
/*** Making a parser. ***/
395
/*** Making a parser. ***/
366
396
Lines 382-387 Link Here
382
  XML_SetCharacterDataHandler(parser,
412
  XML_SetCharacterDataHandler(parser,
383
                              data_handler ? expat_data_handler : NULL);
413
                              data_handler ? expat_data_handler : NULL);
384
414
415
#if XML_VERSION_AT_LEAST(1, 95, 8)
416
  XML_SetEntityDeclHandler(parser, expat_entity_declaration);
417
#else
418
  XML_SetDefaultHandler(parser, expat_default_handler);
419
#endif
420
385
  /* ### we probably don't want this pool; or at least we should pass it
421
  /* ### we probably don't want this pool; or at least we should pass it
386
     ### to the callbacks and clear it periodically.  */
422
     ### to the callbacks and clear it periodically.  */
387
  subpool = svn_pool_create(pool);
423
  subpool = svn_pool_create(pool);
Lines 463-468 Link Here
463
  /* This will cause the current XML_Parse() call to finish quickly! */
499
  /* This will cause the current XML_Parse() call to finish quickly! */
464
  XML_SetElementHandler(svn_parser->parser, NULL, NULL);
500
  XML_SetElementHandler(svn_parser->parser, NULL, NULL);
465
  XML_SetCharacterDataHandler(svn_parser->parser, NULL);
501
  XML_SetCharacterDataHandler(svn_parser->parser, NULL);
502
#if XML_VERSION_AT_LEAST(1, 95, 8)
503
  XML_SetEntityDeclHandler(svn_parser->parser, NULL);
504
#endif
466
505
467
  /* Once outside of XML_Parse(), the existence of this field will
506
  /* Once outside of XML_Parse(), the existence of this field will
468
     cause svn_delta_parse()'s main read-loop to return error. */
507
     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
extern module AP_MODULE_DECLARE_DATA dontdothat_module;
43
extern 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