Permalink
Browse files

Don't write to error_buf if it's 0

  • Loading branch information...
1 parent b5717dc commit fe63f72c0acf90ba7312ae2f76e0fa839f86f96a @udp committed Feb 13, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 json.c
View
3 json.c
@@ -645,7 +645,8 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch
e_failed:
- strcpy (error_buf, *error ? error : "Unknown error");
+ if (error_buf)
+ strcpy (error_buf, *error ? error : "Unknown error");
if (state.first_pass)
alloc = root;

0 comments on commit fe63f72

Please sign in to comment.