yaml2byte has a bug
Status: Alpha
Brought to you by:
whythluckystiff
Hello,
Thanks for your SYCK! ^^
I found a bug!
I compiled syck_0.42 by Borland C++ Compiler 5.5 in
WordowsXP
I found that when I yaml2byte a warning YAML
document, it crashed!
Like this:
---
TEST:
- hello
- world
- {xxx, pp]
TEST2: test: test: test
...
When I run the same program in Linux, syck worked fine!
I traced it,
I found that the problem was in yaml2byte.c, function
syck_yaml2byte(char *yamlstr)
syck_lookup_sym() return 0;
So, it shound modify to
if (syck_lookup_sym( parser, oid, (char **)&sav ) ==
1)
{
ret = S_ALLOC_N( char, strlen( sav->buffer ) +
3 );
ret[0] = '\0';
strcat( ret, "D\n" );
strcat( ret, sav->buffer );
}
else
ret = NULL;
PS: the same problem in Ruby's syck
virtu