Browse files

Properly escape inbound slashes and double-quotes

Change-Id: I38c4d06f9c2c6cae361b9921ad1c51aeb5baacc8
  • Loading branch information...
1 parent 85a66ed commit c619aeab0eac7a244be68417128348d76f28bd91 @rtyler committed Apr 6, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 encoder.c
View
10 encoder.c
@@ -96,6 +96,16 @@ static yajl_gen_status ProcessObject(_YajlEncoder *self, PyObject *object)
buffer[offset++] = 'b';
continue;
break;
+ case '\\':
+ buffer[offset++] = '\\';
+ buffer[offset++] = '\\';
+ continue;
+ break;
+ case '\"':
+ buffer[offset++] = '\\';
+ buffer[offset++] = '\"';
+ continue;
+ break;
default:
break;
}

0 comments on commit c619aea

Please sign in to comment.