apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r658824 - in /apr/apr-util/trunk/dbd: apr_dbd_mysql.c apr_dbd_pgsql.c
Date Wed, 21 May 2008 19:42:16 GMT
Author: bojan
Date: Wed May 21 12:42:16 2008
New Revision: 658824

URL: http://svn.apache.org/viewvc?rev=658824&view=rev
Log:
Explicitly reject row numbers that are not greater than 0 for random access.

Modified:
    apr/apr-util/trunk/dbd/apr_dbd_mysql.c
    apr/apr-util/trunk/dbd/apr_dbd_pgsql.c

Modified: apr/apr-util/trunk/dbd/apr_dbd_mysql.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_mysql.c?rev=658824&r1=658823&r2=658824&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_mysql.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_mysql.c Wed May 21 12:42:16 2008
@@ -271,6 +271,9 @@
             if (rownum > 0) {
                 mysql_stmt_data_seek(res->statement, (my_ulonglong) --rownum);
             }
+            else {
+                return -1; /* invalid row */
+            }
         }
         ret = mysql_stmt_fetch(res->statement);
         switch (ret) {
@@ -290,6 +293,9 @@
             if (rownum > 0) {
                 mysql_data_seek(res->res, (my_ulonglong) --rownum);
             }
+            else {
+                return -1; /* invalid row */
+            }
         }
         r = mysql_fetch_row(res->res);
         if (r == NULL) {

Modified: apr/apr-util/trunk/dbd/apr_dbd_pgsql.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_pgsql.c?rev=658824&r1=658823&r2=658824&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_pgsql.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_pgsql.c Wed May 21 12:42:16 2008
@@ -238,6 +238,9 @@
             if (rownum > 0) {
                 row->n = --rownum;
             }
+            else {
+                return -1; /* invalid row */
+            }
         }
     }
     else {
@@ -248,6 +251,9 @@
             if (rownum > 0) {
                 row->n = --rownum;
             }
+            else {
+                return -1; /* invalid row */
+            }
         }
     }
 



Mime
View raw message