Wolfgang Rohdewald wrote:
char *s;
asprintf(s,%ld-%.9s,random(),artist.original());
segfaults only if illegal utf8 chars appear in artist.original()
asprintf returns -1, so s is nothing that could be freed,
and this gives a nice backtrace:
So its basically just free'ing an
Udo Richter wrote:
Wolfgang Rohdewald wrote:
char *s;
asprintf(s,%ld-%.9s,random(),artist.original());
segfaults only if illegal utf8 chars appear in artist.original()
asprintf returns -1, so s is nothing that could be freed,
and this gives a nice backtrace:
So its
I demand that Ludwig Nussel may or may not have written...
Darren Salt wrote:
I demand that Ludwig Nussel may or may not have written...
[snip]
asprintf needs to check for multibyte characters to not cut them in
the middle and produce invalid output.
No - it's encoding-neutral. [...]
Try
Darren Salt wrote:
I demand that Ludwig Nussel may or may not have written...
[snip]
asprintf needs to check for multibyte characters to not cut them in
the middle and produce invalid output.
No - it's encoding-neutral. What you want is your own version which does that
Try the
On Montag, 11. Februar 2008, Udo Richter wrote:
Well, that leads to the question whether s is unchanged in case of a -1
error return, and whether this would work:
I can confirm that. The man page however says the value will be undefined.
My current understanding is:
1. dont forget to call
Wolfgang Rohdewald wrote:
My problem code:
mgDb::Build_cddbid(const mgSQLString artist) const
{
char *s;
asprintf(s,%ld-%.9s,random(),artist.original());
segfaults only if illegal utf8 chars appear in artist.original()
asprintf returns -1, so s is nothing that could be
Wolfgang Rohdewald wrote:
since asprintf leads to segfaults if feeded with incorrect UTF-8 characters,
It's not asprintf that segfaults but the call to free uninitialized
memory afterwards.
I wanted to write a wrapper function which would then check the return value
of asprintf. However I
Udo Richter wrote:
Wolfgang Rohdewald wrote:
since asprintf leads to segfaults if feeded with incorrect UTF-8 characters,
I wanted to write a wrapper function which would then check the return value
of asprintf.
I never understood what the problem is with utf8 and asprintf, since
utf8
On Montag, 11. Februar 2008, Ludwig Nussel wrote:
As you can see it doesn't segfault on asprintf but on free().
I did see that. I did not say it segfaults but it does lead
to segfaults.
if(asprintf(...) = 0)
{
printf(...);
free(...);
}
I do not want to change dozens of places
On 02/10/08 16:06, Wolfgang Rohdewald wrote:
Hi,
I am making the muggle plugin work with UTF-8 and have a little problem:
since asprintf leads to segfaults if feeded with incorrect UTF-8 characters,
I wanted to write a wrapper function which would then check the return value
of asprintf.
Hi,
I am making the muggle plugin work with UTF-8 and have a little problem:
since asprintf leads to segfaults if feeded with incorrect UTF-8 characters,
I wanted to write a wrapper function which would then check the return value
of asprintf. However I have a problem with the variable argument
On Sonntag, 10. Februar 2008, Klaus Schmidinger wrote:
You could use VDR's cString::sprintf() instead.
This is probably also what I am going to do in the VDR core code,
to avoid asprintf() altogether. The single leftover vasprintf()
call in cString::sprintf() can then be made safe.
vasprintf
Wolfgang Rohdewald wrote:
since asprintf leads to segfaults if feeded with incorrect UTF-8 characters,
I wanted to write a wrapper function which would then check the return value
of asprintf.
I never understood what the problem is with utf8 and asprintf, since
utf8 is mostly ASCIIZ
I demand that Wolfgang Rohdewald may or may not have written...
On Sonntag, 10. Februar 2008, Udo Richter wrote:
What special handling does asprintf with utf8? Is there some example that
causes the trouble?
Worst case I can imagine would be that there's an invalid 0 byte inside
an utf8
14 matches
Mail list logo