Browse Source

- fix regression during value conversion when input SQL string is NULL,
and value type is BLOB, reported from jordan at flowroute dot com


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5459 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt 16 years ago
parent
commit
fd355ee0b0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      modules/db_postgres/km_val.c

+ 2 - 1
modules/db_postgres/km_val.c

@@ -57,7 +57,8 @@
  */
 int db_postgres_str2val(const db_type_t _t, db_val_t* _v, const char* _s, const int _l)
 {
-	if ( (_t != DB_BLOB && _v != NULL) || _v == NULL) {
+	/* use common function for non BLOB, NULL setting and input parameter checking */
+	if ( _t != DB_BLOB || _s == NULL || _v == NULL) {
 		return db_str2val(_t, _v, _s, _l, 1);
 	} else {
 		char * tmp_s = NULL;