Fixed sql bind in loop problem that has been languishing in hiding. sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 25 Mar 2019 16:11:03 +0100
branchsync
changeset 339845fa5be301e8
parent 3397 837e7a550111
child 3399 97762a37bd0f
Fixed sql bind in loop problem that has been languishing in hiding.
src/keymanagement.c
src/pEpEngine.c
     1.1 --- a/src/keymanagement.c	Mon Mar 25 15:18:13 2019 +0100
     1.2 +++ b/src/keymanagement.c	Mon Mar 25 16:11:03 2019 +0100
     1.3 @@ -1656,8 +1656,10 @@
     1.4      unsigned int flags = 0;
     1.5      
     1.6      identity_list *_bl = _own_identities;
     1.7 +
     1.8 +    sqlite3_bind_int(session->own_keys_retrieve, 1, excluded_flags);
     1.9 +
    1.10      do {
    1.11 -        sqlite3_bind_int(session->own_identities_retrieve, 1, excluded_flags);
    1.12          result = sqlite3_step(session->own_identities_retrieve);
    1.13          switch (result) {
    1.14              case SQLITE_ROW:
    1.15 @@ -1749,8 +1751,9 @@
    1.16      char *fpr = NULL;
    1.17      
    1.18      stringlist_t *_bl = _keylist;
    1.19 -    do {
    1.20 -        sqlite3_bind_int(session->own_keys_retrieve, 1, excluded_flags);
    1.21 +    sqlite3_bind_int(session->own_keys_retrieve, 1, excluded_flags);
    1.22 +
    1.23 +    do {        
    1.24          result = sqlite3_step(session->own_keys_retrieve);
    1.25          switch (result) {
    1.26              case SQLITE_ROW:
     2.1 --- a/src/pEpEngine.c	Mon Mar 25 15:18:13 2019 +0100
     2.2 +++ b/src/pEpEngine.c	Mon Mar 25 16:11:03 2019 +0100
     2.3 @@ -11,7 +11,7 @@
     2.4  #include <time.h>
     2.5  #include <stdlib.h>
     2.6  
     2.7 -#define _PEP_SQLITE_DEBUG 0
     2.8 +#define _PEP_SQLITE_DEBUG 1
     2.9  #if _PEP_SQLITE_DEBUG
    2.10  #include <sqlite3.h>
    2.11  #endif
    2.12 @@ -4901,4 +4901,3 @@
    2.13  }
    2.14  
    2.15  #endif
    2.16 -