diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sq/sq_query_helper.c | 8 | ||||
-rw-r--r-- | src/sq/sq_result_helper.c | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/sq/sq_query_helper.c b/src/sq/sq_query_helper.c index a04b4ced4..94a3a3f1c 100644 --- a/src/sq/sq_query_helper.c +++ b/src/sq/sq_query_helper.c | |||
@@ -90,6 +90,14 @@ bind_string (void *cls, | |||
90 | sqlite3_stmt *stmt, | 90 | sqlite3_stmt *stmt, |
91 | unsigned int off) | 91 | unsigned int off) |
92 | { | 92 | { |
93 | if (NULL == data) | ||
94 | { | ||
95 | if (SQLITE_OK != | ||
96 | sqlite3_bind_null (stmt, | ||
97 | (int) off)) | ||
98 | return GNUNET_SYSERR; | ||
99 | return GNUNET_OK; | ||
100 | } | ||
93 | if (SQLITE_OK != | 101 | if (SQLITE_OK != |
94 | sqlite3_bind_text (stmt, | 102 | sqlite3_bind_text (stmt, |
95 | (int) off, | 103 | (int) off, |
diff --git a/src/sq/sq_result_helper.c b/src/sq/sq_result_helper.c index fad3f3c8d..9579863b2 100644 --- a/src/sq/sq_result_helper.c +++ b/src/sq/sq_result_helper.c | |||
@@ -228,6 +228,13 @@ extract_utf8_string (void *cls, | |||
228 | const char *text; | 228 | const char *text; |
229 | char **rdst = dst; | 229 | char **rdst = dst; |
230 | 230 | ||
231 | if (SQLITE_NULL == | ||
232 | sqlite3_column_type (result, | ||
233 | column)) | ||
234 | { | ||
235 | *rdst = NULL; | ||
236 | return GNUNET_OK; | ||
237 | } | ||
231 | if (SQLITE_TEXT != | 238 | if (SQLITE_TEXT != |
232 | sqlite3_column_type (result, | 239 | sqlite3_column_type (result, |
233 | column)) | 240 | column)) |