apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roo...@apache.org
Subject svn commit: r385977 - in /apr/apr-util/branches/1.2.x/dbd: apr_dbd_sqlite2.c apr_dbd_sqlite3.c
Date Wed, 15 Mar 2006 06:04:56 GMT
Author: rooneg
Date: Tue Mar 14 22:04:54 2006
New Revision: 385977

URL: http://svn.apache.org/viewcvs?rev=385977&view=rev
Log:
Merge r384327 from trunk into the 1.2.x branch.

Original log message:

Add or correct bounds checking for sqlite dbd backends.

Submitted by: Bojan Smojver <bojan rexursive.com>

* dbd/apr_dbd_sqlite2.c
  (dbd_sqlite_get_entry): Add bounds checking.

* dbd/apr_dbd_sqlite3.c
  (dbd_sqlite3_get_entry): Correct bounds checking on negative values.

Modified:
    apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite2.c
    apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c

Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite2.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite2.c?rev=385977&r1=385976&r2=385977&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite2.c (original)
+++ apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite2.c Tue Mar 14 22:04:54 2006
@@ -168,6 +168,10 @@
 
 static const char *dbd_sqlite_get_entry(const apr_dbd_row_t * row, int n)
 {
+    if ((n < 0) || (n >= row->res->sz)) {
+      return NULL;
+    }
+
     return row->data[n];
 }
 

Modified: apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c?rev=385977&r1=385976&r2=385977&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c (original)
+++ apr/apr-util/branches/1.2.x/dbd/apr_dbd_sqlite3.c Tue Mar 14 22:04:54 2006
@@ -218,7 +218,7 @@
 {
     apr_dbd_column_t *column;
     const char *value;
-    if ((n + 1) > row->columnCount) {
+    if ((n < 0) || (n >= row->columnCount)) {
         return NULL;
     }
     column = row->columns[n];



Mime
View raw message