Subject: | Segmentation fault because of comment |
At least on my system a single line comment which ends in \ will also take next line as a
comment. This causes problems for the realloc part of the encode code since the buf_len isn't
increased. As a patch I've added a single space after the backslash which makes the code work
on my system and shouldn't cause any problem.
Subject: | hstore.patch |
--- hstore.xs 2012-05-28 11:27:23.000000000 +0200
+++ hstore.xs_fix 2012-05-28 11:27:56.000000000 +0200
@@ -90,7 +90,7 @@
// Check we have buf mem
if( (buf_fill+(vallen+keylen)*2+10) > buf_len ) {
//Add 10 cus it can be 4x'"', 1x' => ', 1x', '
- //We mul to 2 cus each character can be escaped with \
+ //We mul to 2 cus each character can be escaped with \
buf_len += (vallen+keylen)*2+10+ENCODE_BUF;
char *newbuf = (char*)realloc(buf, buf_len);
if( newbuf == NULL ) {