Displaying 4 results from an estimated 4 matches for "t_str_tabunescape".
2016 Oct 17
2
Dict proxy client returning empty string instead of multiline string
...just copies pointer to the value, it should, instead, duplicate the value to some memory region. Can you see if this following patch fixes it?
Aki
> On October 17, 2016 at 4:14 PM Pierre Jaury <pierre at jaury.eu> wrote:
>
>
> Okay, it seems to me that the bug is due to "t_str_tabunescape" using
> the unsafe datastack ("t_strdup_noconst") while the string is actually
> returned in an async callback.
>
> Before it is handled by "client_dict_lookup", "client_dict_wait"
> actually fires some IO loops that are more than likely to call &...
2016 Oct 17
1
Dict proxy client returning empty string instead of multiline string
...printf(">%s\n", value); // outputs an empty string
dict_deinit(&dict);
I trimmed it to the bare minimal string manipulation functions involved
but cannot reproduce in that case:
pool_t pool = pool_datastack_create();
char* s1 = "test\001n\001rtest";
char* s2 = t_str_tabunescape(s1);
char* s3 = p_strdup(pool, s2);
printf("1>%s\n", s1);
printf("2>%s\n", s2);
printf("3>%s\n", s3); // all three output the string with NL and CR
Maybe I am missing a function call in the process or maybe the issue is
related to the way unescaping...
2016 Oct 17
2
Dict proxy client returning empty string instead of multiline string
...the value to some memory region. Can you see if this following patch fixes it?
> >
> > Aki
> >
> >> On October 17, 2016 at 4:14 PM Pierre Jaury <pierre at jaury.eu> wrote:
> >>
> >>
> >> Okay, it seems to me that the bug is due to "t_str_tabunescape" using
> >> the unsafe datastack ("t_strdup_noconst") while the string is actually
> >> returned in an async callback.
> >>
> >> Before it is handled by "client_dict_lookup", "client_dict_wait"
> >> actually fires some...
2016 Oct 17
2
Dict proxy client returning empty string instead of multiline string
Hi!
This does sound like a bug, we'll have look.
Aki
On 17.10.2016 01:26, Pierre Jaury wrote:
> I dived a little bit further into the rabbit hole, up to the point where
> debugging has become unpracticle but I still haven't found the root
> cause for sure.
>
> I read most of the code for "p_strdup" based on datastack memory pools
> (which are used for