[OpenSER-Devel] replace fails with E_BUG in fixup function

Henning Westerholt henning.westerholt at 1und1.de
Mon Aug 27 16:30:54 CEST 2007


On Thursday 16 August 2007, Ben Smithurst wrote:
> Hi,
>
> I have noticed having recently updated my SVN directory that the replace
> function from textops now fails with E_BUG in the fixup function (i.e.
> fails when parsing the config).
>
> This appears to be the result of this change to textops.c:
>
> ------------------------------------------------------------------------
> r2119 | henningw | 2007-05-02 15:32:20 +0100 (Wed, 02 May 2007) | 3 lines
> [..]
> Previously, the code would just do 'return 0' in the param_no != 1 case,
> now it returns E_BUG which appears to make openser crash.
>
> I have attached a patch which restores the previous behaviour while
> still using the generic fixup_str2regexp function, however I am curious
> if I am doing something wrong?  It seems odd this problem could have
> been unnoticed for 3 months.
>
> My config file just does a fairly simple replace("string1", "string2").
>
> If I'm doing something wrong please let me know, otherwise, the attached
> patch should hopefully be ok.  Please note I have only tested the change
> with the 'replace' function however the other similar functions should
> work the same way, I think.

Hello Ben,

thank you for the report. 

I've made a fix to the regexp fixup function in mod_fix.h. Now the old 
behaviour is restored, return 0 for any parameter != 1. Could you please test 
this change with your config?

Best regards,

Henning



More information about the Devel mailing list