[Opendnssec-commits] sion r7054 - in branches/OpenDNSSEC-1.3/enforcer: enforcerd utils

commits at svn.opendnssec.org commits at svn.opendnssec.org
Thu Feb 21 17:14:54 CET 2013


Author: sion
Date: Thu Feb 21 17:14:54 2013
New Revision: 7054
URL: http://fisheye.opendnssec.org/changelog/opendnssec?cs=7054

Log:
fix some build warnings.

Modified:
   branches/OpenDNSSEC-1.3/enforcer/enforcerd/enforcer.c
   branches/OpenDNSSEC-1.3/enforcer/utils/ksmutil.c

Modified: branches/OpenDNSSEC-1.3/enforcer/enforcerd/enforcer.c
==============================================================================
--- branches/OpenDNSSEC-1.3/enforcer/enforcerd/enforcer.c	Thu Feb 21 17:10:40 2013	(r7053)
+++ branches/OpenDNSSEC-1.3/enforcer/enforcerd/enforcer.c	Thu Feb 21 17:14:54 2013	(r7054)
@@ -1493,6 +1493,14 @@
                     " or state = %d and DEAD > DATETIME('%s', '-%d SECONDS')) ", KSM_STATE_DEAD, rightnow, interval);
 #endif /* USE_MYSQL */
 
+			if (nchar >= sizeof(buffer)) {
+				log_msg(NULL, LOG_ERR, "Error: failed to create SQL statement to purge keys\n");
+				DbStringFree(temp_loc);
+                DbFreeRow(row);
+                StrFree(rightnow);
+				return(-1);
+			}
+
             StrAppend(&sql1, buffer);
             DqsEnd(&sql1);
 

Modified: branches/OpenDNSSEC-1.3/enforcer/utils/ksmutil.c
==============================================================================
--- branches/OpenDNSSEC-1.3/enforcer/utils/ksmutil.c	Thu Feb 21 17:10:40 2013	(r7053)
+++ branches/OpenDNSSEC-1.3/enforcer/utils/ksmutil.c	Thu Feb 21 17:14:54 2013	(r7054)
@@ -7365,6 +7365,12 @@
                 "DATETIME('%s', '+%d SECONDS') ", datetime, deltat);
 #endif /* USE_MYSQL */
 
+		if (nchar >= sizeof(buffer)) {
+            status = -1;
+			printf("Error: failed to create SQL statement\n");
+            return status;
+        }
+
         sql1 = DusInit("dnsseckeys");
         DusSetInt(&sql1, "STATE", KSM_STATE_ACTIVE, 0);
         DusSetString(&sql1, KsmKeywordStateValueToName(KSM_STATE_ACTIVE), datetime, 1);
@@ -7390,6 +7396,12 @@
                 "DATETIME('%s', '+%d SECONDS') ", datetime, deltat);
 #endif /* USE_MYSQL */
 
+		if (nchar >= sizeof(buffer)) {
+            status = -1;
+			printf("Error: failed to create SQL statement\n");
+            return status;
+        }
+
         sql1 = DusInit("dnsseckeys");
         DusSetInt(&sql1, "STATE", KSM_STATE_DSPUBLISH, 0);
         DusSetString(&sql1, KsmKeywordStateValueToName(KSM_STATE_PUBLISH), datetime, 1);
@@ -7507,6 +7519,12 @@
         "DATETIME('%s', '+%d SECONDS') ", datetime, deltat);
 #endif /* USE_MYSQL */
 
+	if (nchar >= sizeof(buffer)) {
+		status = -1;
+		printf("Error: failed to create SQL statement\n");
+		return status;
+	}
+
     sql2 = DusInit("dnsseckeys");
     DusSetInt(&sql2, "STATE", KSM_STATE_RETIRE, 0);
     DusSetString(&sql2, KsmKeywordStateValueToName(KSM_STATE_RETIRE), datetime, 1);
@@ -7755,6 +7773,12 @@
                 "DATETIME('%s', '+%d SECONDS') ", datetime, deltat);
 #endif /* USE_MYSQL */
 
+		if (nchar >= sizeof(buffer)) {
+            status = -1;
+			printf("Error: failed to create SQL statement\n");
+            return status;
+        }
+
         sql1 = DusInit("dnsseckeys");
         DusSetInt(&sql1, "STATE", KSM_STATE_ACTIVE, 0);
         DusSetString(&sql1, KsmKeywordStateValueToName(KSM_STATE_ACTIVE), datetime, 1);
@@ -7787,6 +7811,12 @@
                 "DATETIME('%s', '+%d SECONDS') ", datetime, deltat);
 #endif /* USE_MYSQL */
 
+		if (nchar >= sizeof(buffer)) {
+            status = -1;
+			printf("Error: failed to create SQL statement\n");
+            return status;
+        }
+
         sql1 = DusInit("dnsseckeys");
         DusSetInt(&sql1, "STATE", KSM_STATE_RETIRE, 0);
         DusSetString(&sql1, KsmKeywordStateValueToName(KSM_STATE_RETIRE), datetime, 1);
@@ -7812,6 +7842,12 @@
                 "DATETIME('%s', '+%d SECONDS') ", datetime, deltat);
 #endif /* USE_MYSQL */
 
+		if (nchar >= sizeof(buffer)) {
+            status = -1;
+			printf("Error: failed to create SQL statement\n");
+            return status;
+        }
+
         sql1 = DusInit("dnsseckeys");
         DusSetInt(&sql1, "STATE", KSM_STATE_DSPUBLISH, 0);
         DusSetString(&sql1, KsmKeywordStateValueToName(KSM_STATE_PUBLISH), datetime, 1);



More information about the Opendnssec-commits mailing list