libgda r3112 - in branches/libgda-3-2: . providers/postgres
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: libgda r3112 - in branches/libgda-3-2: . providers/postgres
- Date: Fri, 4 Apr 2008 14:50:16 +0100 (BST)
Author: murrayc
Date: Fri Apr 4 14:50:16 2008
New Revision: 3112
URL: http://svn.gnome.org/viewvc/libgda?rev=3112&view=rev
Log:
2008-04-04 Murray Cumming <murrayc murrayc com>
* providers/postgres/utils.c (gda_postgres_type_oid_to_gda):
Prevent an access outside of an array, as found by valgrind.
Modified:
branches/libgda-3-2/ChangeLog
branches/libgda-3-2/providers/postgres/utils.c
Modified: branches/libgda-3-2/providers/postgres/utils.c
==============================================================================
--- branches/libgda-3-2/providers/postgres/utils.c (original)
+++ branches/libgda-3-2/providers/postgres/utils.c Fri Apr 4 14:50:16 2008
@@ -120,6 +120,14 @@
if (type_data[i].oid == postgres_type)
break;
+ /* Avoid accessing position -1: */
+ if(ntypes == 0)
+ return G_TYPE_STRING;
+
+ /* Avoid accessing beyone the array: */
+ if(i >= ntypes)
+ i = ntypes -1;
+
if (type_data[i].oid != postgres_type)
return G_TYPE_STRING;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]