[28840] in Source-Commits

home help back first fref pref prev next nref lref last post

moira commit [debian]: Check if owner is non-empty string; don't cast in a weird way.

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Wed Apr 25 23:50:09 2018

Date: Wed, 25 Apr 2018 23:49:55 -0400
From: Anders Kaseorg <andersk@mit.edu>
Message-Id: <201804260349.w3Q3ntro024862@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/moira/commit/efd707f73db11878e7c098cf350f0b5d83e2cfe5
commit efd707f73db11878e7c098cf350f0b5d83e2cfe5
Author: Garry Zacheiss <zacheiss@mit.edu>
Date:   Sat Mar 18 13:53:58 2017 -0400

    Check if owner is non-empty string; don't cast in a weird way.

 moira/server/qvalidate.pc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/moira/server/qvalidate.pc b/moira/server/qvalidate.pc
index 08ab594..c4931a3 100644
--- a/moira/server/qvalidate.pc
+++ b/moira/server/qvalidate.pc
@@ -401,7 +401,7 @@ int validate_typedata(struct query *q, char *argv[], struct valobj *vo)
 	   * that we're trying to resolve, we should get the value of
 	   * numvalues.[idfield] for the id.
 	   */
-	  if (vo->idfield && (*(int *)argv[0] == *(int *)argv[vo->index]))
+	  if (vo->idfield && *argv[vo->index] && !(strcmp(argv[0], argv[vo->index])))
 	    {
 	      set_next_object_id(q->validate->object_id, q->rtable, 0);
 	      name = vo->idfield;

home help back first fref pref prev next nref lref last post