blob: ff42752a44652e76289874d67509de75525d1426 [file] [log] [blame]
Holger Hans Peter Freyther0eafd562014-04-08 19:43:14 +02001This is a backport of a fix from Holger Freyther to the
2libdbd sqlite3 driver.
3
4Index: libdbi-drivers-0.8.3-1/drivers/sqlite3/dbd_sqlite3.c
5===================================================================
6--- libdbi-drivers-0.8.3-1.orig/drivers/sqlite3/dbd_sqlite3.c
7+++ libdbi-drivers-0.8.3-1/drivers/sqlite3/dbd_sqlite3.c
8@@ -502,7 +502,8 @@ size_t dbd_quote_binary(dbi_conn_t *conn
9 unsigned char *temp;
10 size_t len;
11
12- if ((temp = malloc(from_length*2)) == NULL) {
13+ /* allocate an extra byte for NULL and two for the quotes */
14+ if ((temp = malloc(2*from_length+1+2)) == NULL) {
15 return 0;
16 }
17