httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: Really big regex results from ap_pregsub
Date Thu, 13 Oct 2011 19:32:47 GMT
We have 2 conditions:

  1. nmatch > AP_MAX_REG_MATCH
  2. really big string

For #1 we can either choose to return NULL or "". Since
most calls to ap_pregsub() aren't checked, "" might be safer.
And, at least, it indicates an error (or can indicate one).

For #2 we can choose to also limit the returned string size
and only populate the string up to some large but safe limit
OR return NULL OR return ""

All in all, after really mulling it over, using "" as our
default error seems safest for pre-2.4. For 2.4, we should
fix our errors to return NULL (and update our own modules
to catch that) and fix that API.

Mime
View raw message