]> andersk Git - moira.git/commitdiff
Use moira_schema.h
authordanw <danw>
Mon, 23 Feb 1998 19:24:28 +0000 (19:24 +0000)
committerdanw <danw>
Mon, 23 Feb 1998 19:24:28 +0000 (19:24 +0000)
Check return value of malloc (or use xmalloc to malloc-or-die).
Prevent a handful of buffer overruns

19 files changed:
server/Imakefile
server/cache.pc
server/increment.pc
server/mr_glue.c
server/mr_main.c
server/mr_sauth.c
server/mr_scall.c
server/mr_server.h
server/mr_util.c
server/qaccess.pc
server/qfollow.pc
server/qrtn.h
server/qrtn.pc
server/qsetup.pc
server/qsubs.c
server/qsupport.pc
server/queries2.c
server/query.h
server/qvalidate.pc

index 6cd73bc0657a13d37f0980160ea6388965b200a2..0811d22c3429206a896f80c443664407c41b631f 100644 (file)
@@ -25,7 +25,7 @@ CODE= startmoira.c mr_main.c mr_sauth.c mr_scall.c \
 SRVOBJ=mr_main.o mr_sauth.o mr_scall.o mr_shutdown.o \
        mr_util.o qrtn.o queries2.o qsupport.o qsubs.o \
        increment.o cache.o qvalidate.o \
-       qaccess.o qsetup.o qfollow.o
+       qaccess.o qsetup.o qfollow.o ../db/moira_schema.o
 GLUOBJS=mr_glue.o qrtn.o queries2.o qsupport.o qsubs.o \
        ../lib/mr_et.o mr_sauth.o \
        ../lib/krb_et.o mr_util.o increment.o cache.o \
index 72d2f9f9999bad70528d8488bdd14f0b2edcffee..68f5ffe8786479d0f0be187b8163e89fa082e024 100644 (file)
@@ -24,10 +24,9 @@ extern char *whoami;
 
 /* Cache parameters: */
 #define CACHESIZE 101          /* number of cache slots */
-#define NAMESZ 257             /* max size of a name */
 
 struct item {
-  char name[NAMESZ];
+  char name[MAX_FIELD_WIDTH];
   enum tables type;
   int nhash;
   int id;
@@ -135,7 +134,7 @@ int name_to_id(char *name, enum tables type, int *id)
     case SUBNET_TABLE:
       EXEC SQL SELECT snet_id INTO :j FROM subnet WHERE name = UPPER(:iname);
       break;
-    case CLUSTER_TABLE:
+    case CLUSTERS_TABLE:
       EXEC SQL SELECT clu_id INTO :j FROM clusters WHERE name = :iname;
       break;
     case FILESYS_TABLE:
@@ -164,6 +163,8 @@ int name_to_id(char *name, enum tables type, int *id)
   if (cachesize < CACHESIZE)
     {
       i = malloc(sizeof(struct item));
+      if (!i)
+       return MR_SUCCESS;
       cachesize++;
     }
   else
@@ -199,7 +200,7 @@ int id_to_name(int id, enum tables type, char **name)
 {
   struct item *i, *t;
   EXEC SQL BEGIN DECLARE SECTION;
-  char iname[NAMESZ];
+  char iname[MAX_FIELD_WIDTH];
   int j;
   EXEC SQL END DECLARE SECTION;
 
@@ -208,7 +209,7 @@ int id_to_name(int id, enum tables type, char **name)
       if (i->id != id || type != i->type)
        continue;
       free(*name);
-      *name = strdup(i->name);
+      *name = xstrdup(i->name);
       cachehits++;
       i->next->prev = i->prev;
       i->prev->next = i->next;
@@ -236,7 +237,7 @@ int id_to_name(int id, enum tables type, char **name)
     case SUBNET_TABLE:
       EXEC SQL SELECT name INTO :iname FROM subnet WHERE snet_id = :j;
       break;
-    case CLUSTER_TABLE:
+    case CLUSTERS_TABLE:
       EXEC SQL SELECT name INTO :iname FROM clusters WHERE clu_id = :j;
       break;
     case FILESYS_TABLE:
@@ -252,7 +253,7 @@ int id_to_name(int id, enum tables type, char **name)
     {
       free(*name);
       sprintf(iname, "#%d", j);
-      *name = strdup(iname);
+      *name = xstrdup(iname);
       return MR_NO_MATCH;
     }
   if (sqlca.sqlerrd[2] > 1)
@@ -260,12 +261,14 @@ int id_to_name(int id, enum tables type, char **name)
   if (sqlca.sqlcode)
     return MR_DBMS_ERR;
   free(*name);
-  *name = strdup(strtrim(iname));
+  *name = xstrdup(strtrim(iname));
   if (**name == '#' && type != USERS_TABLE)
     return MR_SUCCESS;
   if (cachesize < CACHESIZE)
     {
       i = malloc(sizeof(struct item));
+      if (!i)
+       return MR_SUCCESS;
       cachesize++;
     }
   else
@@ -315,6 +318,8 @@ int cache_entry(char *name, enum tables type, int id)
   if (cachesize < CACHESIZE)
     {
       i = malloc(sizeof(struct item));
+      if (!i)
+       return MR_SUCCESS;
       cachesize++;
     }
   else
index 27f540e6eb8acdeb7bfeedf08232e148a1b974fe..12ad9c37ba316f90247119788e7697aab3a1ce44 100644 (file)
@@ -56,7 +56,6 @@ struct iupdate {
 };
 
 void next_incremental(void);
-char **copy_argv(char **argv, int argc);
 void free_argv(char **argv, int argc);
 int table_num(char *table);
 
@@ -71,8 +70,8 @@ void incremental_init(void)
 
   for (i = 0; i < MAXARGC; i++)
     {
-      before[i] = malloc(ARGLEN);
-      after[i] = malloc(ARGLEN);
+      before[i] = xmalloc(MAX_FIELD_WIDTH);
+      after[i] = xmalloc(MAX_FIELD_WIDTH);
     }
 }
 
@@ -104,7 +103,7 @@ void incremental_before(enum tables table, char *qual, char **argv)
       dosql(before);
       beforec = 2;
       break;
-    case CLUSTER_TABLE:
+    case CLUSTERS_TABLE:
       sprintf(stmt_buf, "SELECT c.name, c.description, c.location "
              "FROM clusters c WHERE %s", qual);
       dosql(before);
@@ -222,7 +221,7 @@ void incremental_after(enum tables table, char *qual, char **argv)
       dosql(after);
       afterc = 2;
       break;
-    case CLUSTER_TABLE:
+    case CLUSTERS_TABLE:
       sprintf(stmt_buf, "SELECT c.name, c.description, c.location "
              "FROM clusters c WHERE %s", qual);
       dosql(after);
@@ -311,12 +310,12 @@ void incremental_after(enum tables table, char *qual, char **argv)
       break;
     }
 
-  iu = malloc(sizeof(struct iupdate));
+  iu = xmalloc(sizeof(struct iupdate));
   iu->table = table_name[table];
   iu->beforec = beforec;
-  iu->before = copy_argv(before, beforec);
+  iu->before = mr_copy_args(before, beforec);
   iu->afterc = afterc;
-  iu->after = copy_argv(after, afterc);
+  iu->after = mr_copy_args(after, afterc);
   sq_save_data(incremental_sq, iu);
 }
 
@@ -343,7 +342,7 @@ void incremental_update(void)
   static struct inc_cache *cache;
   struct inc_cache *c;
   EXEC SQL BEGIN DECLARE SECTION;
-  char tab[17], serv[17];
+  char tab[INCREMENTAL_TABLE_NAME_SIZE], serv[INCREMENTAL_SERVICE_SIZE];
   EXEC SQL END DECLARE SECTION;
   struct iupdate *iu;
 
@@ -359,10 +358,10 @@ void incremental_update(void)
          EXEC SQL FETCH inc INTO :tab, :serv;
          if (sqlca.sqlcode)
            break;
-         c = malloc(sizeof(struct inc_cache));
+         c = xmalloc(sizeof(struct inc_cache));
          c->next = cache;
-         c->table = strdup(strtrim(tab));
-         c->service = strdup(strtrim(serv));
+         c->table = xstrdup(strtrim(tab));
+         c->service = xstrdup(strtrim(serv));
          cache = c;
        }
       EXEC SQL CLOSE inc;
@@ -377,8 +376,15 @@ void incremental_update(void)
            {
              iu->service = c->service;
              sq_save_data(incremental_exec, iu);
+             break;
            }
        }
+      if (!c)
+       {
+         free_argv(iu->before, iu->beforec);
+         free_argv(iu->after, iu->afterc);
+         free(iu);
+       }
     }
   if (inc_running == 0)
     next_incremental();
@@ -388,7 +394,7 @@ void incremental_update(void)
 void next_incremental(void)
 {
   struct iupdate *iu;
-  char *argv[MAXARGC * 2 + 4], cafter[3], cbefore[3], prog[BUFSIZ];
+  char *argv[MAXARGC * 2 + 4], cafter[3], cbefore[3], prog[MAXPATHLEN];
   int i;
   sigset_t sigs;
 
@@ -460,14 +466,6 @@ void incremental_flush(void)
 }
 
 
-char **copy_argv(char **argv, int argc)
-{
-  char **ret = malloc(sizeof(char *) * argc);
-  while (--argc >= 0)
-    ret[argc] = strdup(strtrim(argv[argc]));
-  return ret;
-}
-
 void free_argv(char **argv, int argc)
 {
   while (--argc >= 0)
index b1ee8f94c67dfbc1fe84cf261a15482064b8d648..117e3db4cdfc30ff7d2737605fd6999c5459eb10 100644 (file)
@@ -86,7 +86,7 @@ int mr_noop(void)
 int mr_auth(char *prog)
 {
   struct passwd *pw;
-  char buf[1024];
+  char buf[MAX_K_NAME_SZ];
 
   CHECK_CONNECTED;
   pw = getpwuid(getuid());
@@ -154,7 +154,7 @@ struct query pseudo_query = {
 int trigger_dcm(struct query *q, char *argv[], client *cl)
 {
   int pid, status;
-  char prog[128];
+  char prog[MAXPATHLEN];
 
   if ((status = check_query_access(&pseudo_query, 0, cl)))
     return status;
index 591eabc15f2079fcea04539e9db81d4106c6aad9..13c85701203b778d67a0e753ce245564b50986a6 100644 (file)
@@ -135,7 +135,7 @@ int main(int argc, char **argv)
       com_err(whoami, errno, "Unable to get local hostname");
       exit(1);
     }
-  host = canonicalize_hostname(strdup(uts.nodename));
+  host = canonicalize_hostname(xstrdup(uts.nodename));
   for (p = host; *p && *p != '.'; p++)
     {
       if (isupper(*p))
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
    */
   nclients = 0;
   clientssize = 10;
-  clients = malloc(clientssize * sizeof(client *));
+  clients = xmalloc(clientssize * sizeof(client *));
 
   mr_setup_signals();
 
index 817888c775759a3621a40f40c93931a88100c594..2cca856708271c21314f3745ba3b67a8ccc3fe1e 100644 (file)
@@ -62,7 +62,7 @@ void do_auth(client *cl, mr_params req)
 
   if (!rcache)
     {
-      rcache = malloc(sizeof(replay_cache));
+      rcache = xmalloc(sizeof(replay_cache));
       memset(rcache, 0, sizeof(replay_cache));
     }
 
@@ -84,7 +84,7 @@ void do_auth(client *cl, mr_params req)
 
   /* add new entry */
   time(&now);
-  rcnew = malloc(sizeof(replay_cache));
+  rcnew = xmalloc(sizeof(replay_cache));
   memcpy(&(rcnew->auth), &auth, sizeof(KTEXT_ST));
   rcnew->expires = now + 2 * CLOCK_SKEW;
   rcnew->next = rcache->next;
@@ -106,7 +106,9 @@ void do_auth(client *cl, mr_params req)
   memcpy(cl->kname.name, ad.pname, ANAME_SZ);
   memcpy(cl->kname.inst, ad.pinst, INST_SZ);
   memcpy(cl->kname.realm, ad.prealm, REALM_SZ);
-  strcpy(cl->clname, kname_unparse(ad.pname, ad.pinst, ad.prealm));
+  strncpy(cl->clname, kname_unparse(ad.pname, ad.pinst, ad.prealm),
+         sizeof(cl->clname));
+  cl->clname[sizeof(cl->clname) - 1] = '\0';
 
   if (ad.pinst[0] == 0 && !strcmp(ad.prealm, krb_realm))
     ok = 1;
index 82cfed56e1c6010177b3bfaedf7033fb3bcafa20..b3d3f2c4ecb4df5887fa4d4c3c3beb2e8ea04b99 100644 (file)
@@ -74,6 +74,7 @@ void client_read(client *cl)
     {
       com_err(whoami, 0, "procno out of range");
       client_reply(cl, MR_UNKNOWN_PROC);
+      mr_destroy_reply(req);
       return;
     }
   log_args(procnames[pn], 2, req.mr_argc, req.mr_argv);
@@ -82,6 +83,7 @@ void client_read(client *cl)
     {
       client_reply(cl, MR_DOWN);
       com_err(whoami, MR_DOWN, "(query refused)");
+      mr_destroy_reply(req);
       return;
     }
 
@@ -92,32 +94,33 @@ void client_read(client *cl)
     {
     case MR_NOOP:
       client_reply(cl, MR_SUCCESS);
-      return;
+      break;
 
     case MR_AUTH:
       do_auth(cl, req);
-      return;
+      break;
 
     case MR_QUERY:
       do_retr(cl, req);
-      return;
+      break;
 
     case MR_ACCESS:
       do_access(cl, req);
-      return;
+      break;
 
     case MR_SHUTDOWN:
       do_shutdown(cl);
-      return;
+      break;
 
     case MR_DO_UPDATE:
       client_reply(cl, MR_PERM);
-      return;
+      break;
 
     case MR_MOTD:
       get_motd(cl);
-      return;
+      break;
     }
+  mr_destroy_reply(req);
 }
 
 /* Set the final return status for a query. We always keep one more
index 6d9d10ef349845d2732c580e88b7f062397151ff..04331a8a9042935c52bdea16608be55db642ce91 100644 (file)
@@ -8,6 +8,7 @@
 #include <moira.h>
 #include <mr_private.h>
 #include <moira_site.h>
+#include <moira_schema.h>
 
 #include <netinet/in.h>
 
@@ -127,13 +128,14 @@ void sigshut(int);
 void do_shutdown(client *cl);
 
 /* prototypes from mr_util.c */
-char *requote(char *buf, char *cp, int len);
+char *requote(char *buf);
 void log_args(char *tag, int version, int argc, char **argv);
 void mr_com_err(const char *whoami, long code, const char *fmt, va_list pvar);
 int mr_trim_args(int argc, char **argv);
 char **mr_copy_args(char **argv, int argc);
 void *xmalloc(size_t);
 void *xrealloc(void *, size_t);
+char *xstrdup(char *);
 
 /* prototypes from qaccess.pc */
 int access_user(struct query *q, char *argv[], client *cl);
index 433f1893b4037aa8064cd8ae1d58fdf9e7192659..6c6e58197c49966c0d94ad3967a91a3f638f1b93 100644 (file)
@@ -17,60 +17,67 @@ RCSID("$Header$");
 
 extern char *whoami;
 
-char *requote(char *buf, char *cp, int len)
+char *requote(char *cp)
 {
-  int count = 0;
-  unsigned char c;
-  if (len <= 2)
-    return buf;
-  *buf++ = '"';
-  count++;
-  len--;
-  for (; (count < 258) && (len > 1) && (c = *cp); cp++, --len, ++count)
+  int len = 0;
+  char *out = xmalloc(4 * strlen(cp) + 3), *op = out;
+
+  *op++ = '"';
+  len++;
+  while (*cp)
     {
-      if (c == '\\' || c == '"')
-       *buf++ = '\\';
-      if (isprint(c))
-       *buf++ = c;
+      if (*cp == '\\' || *cp == '"')
+       {
+         *op++ = '\\';
+         len++;
+       }
+      if (isprint(*cp))
+       {
+         *op++ = *cp++;
+         len++;
+       }
       else
        {
-         sprintf(buf, "\\%03o", c);
-         buf = strchr(buf, '\0');
+         sprintf(op, "\\%03o", *cp++);
+         op += 4;
+         len += 4;
        }
     }
-  if (len > 1)
-    {
-      *buf++ = '"';
-      count++;
-      len--;
-    }
-  if (len > 1)
-    *buf = '\0';
-  return buf;
+
+  strcpy(op, "\"");
+  len += 2;
+
+  out = realloc(out, len); /* shrinking, so can't fail */
+  return out;
 }
 
 void log_args(char *tag, int version, int argc, char **argv)
 {
-  char buf[BUFSIZ];
-  int i;
+  char *buf, **qargv;
+  int i, len;
   char *bp;
 
-  i = strlen(tag);
-  sprintf(buf, "%s[%d]: ", tag, version);
-  for (bp = buf; *bp; bp++)
-    ;
+  qargv = xmalloc(argc * sizeof(char *));
 
-  for (i = 0; i < argc && ((buf - bp) + BUFSIZ) > 2; i++)
+  for (i = len = 0; i < argc; i++)
     {
-      if (i != 0)
-       {
-         *bp++ = ',';
-         *bp++ = ' ';
-       }
-      bp = requote(bp, argv[i], (buf - bp) + BUFSIZ);
+      qargv[i] = requote(argv[i]);
+      len += strlen(qargv[i]) + 2;
     }
-  *bp = '\0';
-  com_err(whoami, 0, "%s", buf);
+
+  buf = xmalloc(len + 1);
+
+  for (i = 0, *buf = '\0'; i < argc; i++)
+    {
+      if (i)
+       strcat(buf, ", ");
+      strcat(buf, qargv[i]);
+      free(qargv[i]);
+    }
+  free(qargv);
+
+  com_err(whoami, 0, "%s[%d]: %s", tag, version, buf);
+  free(buf);
 }
 
 void mr_com_err(const char *whoami, long code, const char *fmt, va_list pvar)
@@ -141,11 +148,9 @@ char **mr_copy_args(char **argv, int argc)
   char **a;
   int i;
 
-  a = malloc(argc * sizeof(char *));
-  if (!a)
-    return a;
+  a = xmalloc(argc * sizeof(char *));
   for (i = 0; i < argc; i++)
-    a[i] = strdup(argv[i]);
+    a[i] = xstrdup(argv[i]);
   return a;
 }
 
@@ -172,3 +177,14 @@ void *xrealloc(void *ptr, size_t bytes)
   critical_alert("moirad", "Out of memory");
   exit(1);
 }
+
+char *xstrdup(char *str)
+{
+  char *buf = strdup(str);
+
+  if (buf)
+    return buf;
+
+  critical_alert("moirad", "Out of memory");
+  exit(1);
+}
index f7040868d9f1342cbbc4f8ed0b346f138ad28cad..0467703ee541f2fb6035c2cca787d58b86278b7d 100644 (file)
@@ -22,10 +22,6 @@ RCSID("$Header$");
 extern char *whoami;
 extern int dbms_errno, mr_errcode;
 
-EXEC SQL BEGIN DECLARE SECTION;
-extern char stmt_buf[];
-EXEC SQL END DECLARE SECTION;
-
 EXEC SQL WHENEVER SQLERROR DO dbmserr();
 
 
@@ -98,7 +94,7 @@ int access_login(struct query *q, char *argv[], client *cl)
  * Inputs: argv[0] - list_id
  *         q - query name
  *         argv[2] - member ID (only for queries "amtl" and  "dmfl")
- *         argv[7] - group IID (only for query "ulis")
+ *         argv[7] - group ID (only for query "ulis")
  *          cl - client name
  *
  * - check that client is a member of the access control list
@@ -110,7 +106,7 @@ int access_list(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int list_id, acl_id, flags, gid, users_id;
-  char acl_type[9], name[33], *newname;
+  char acl_type[LIST_ACL_TYPE_SIZE], name[LIST_NAME_SIZE], *newname;
   EXEC SQL END DECLARE SECTION;
   int status;
 
@@ -173,7 +169,7 @@ int access_visible_list(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int list_id, acl_id, flags ;
-  char acl_type[9];
+  char acl_type[LIST_ACL_TYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
   int status;
 
@@ -207,7 +203,7 @@ int access_vis_list_by_name(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int acl_id, flags, rowcount;
-  char acl_type[9], *listname;
+  char acl_type[LIST_ACL_TYPE_SIZE], *listname;
   EXEC SQL END DECLARE SECTION;
   int status;
 
@@ -279,7 +275,7 @@ int access_service(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int acl_id;
-  char *name, acl_type[9];
+  char *name, acl_type[LIST_ACL_TYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
   int status;
   char *c;
@@ -339,7 +335,7 @@ int access_host(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int mid, sid, id;
-  char mtype[9], stype[9];
+  char mtype[MACHINE_OWNER_TYPE_SIZE], stype[SUBNET_OWNER_TYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
   int status;
 
@@ -373,7 +369,7 @@ int access_host(struct query *q, char *argv[], client *cl)
     {
       EXEC SQL BEGIN DECLARE SECTION;
       int status, acomment, use, ocomment, snid;
-      char contact[33], address[33];
+      char contact[MACHINE_CONTACT_SIZE], address[MACHINE_ADDRESS_SIZE];
       EXEC SQL END DECLARE SECTION;
 
       id = *(int *)argv[0];
@@ -432,7 +428,7 @@ int access_ahal(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int cnt, id, mid, sid;
-  char mtype[256], stype[256];
+  char mtype[MACHINE_OWNER_TYPE_SIZE], stype[SUBNET_OWNER_TYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
   int status;
 
index 713ebfb2b5cdb2ff16dd9f070d37b98acad2ebe2..0da7aff2ab5aea77dbbc89fcf1987a29fc500169 100644 (file)
@@ -32,8 +32,6 @@ EXEC SQL BEGIN DECLARE SECTION;
 extern char stmt_buf[];
 EXEC SQL END DECLARE SECTION;
 
-static void hex_dump(unsigned char *p);
-
 EXEC SQL WHENEVER SQLERROR DO dbmserr();
 
 
@@ -334,14 +332,14 @@ int followup_guax(struct query *q, struct save_queue *sq, struct validate *v,
   int i, j;
   char **argv;
 #ifdef GDSS
-  unsigned char sigbuf[256];
+  unsigned char sigbuf[512];
   char *kname;
   SigInfo  si;
   EXEC SQL BEGIN DECLARE SECTION;
   int timestamp, who;
   char *login;
-  char rsig[256];
-  EXEC SQL VAR rsig IS STRING(256);
+  char rsig[USERS_SIGNATURE_SIZE];
+  EXEC SQL VAR rsig IS STRING(USERS_SIGNATURE_SIZE);
   EXEC SQL END DECLARE SECTION;
 #endif /* GDSS */
   int id, status;
@@ -365,17 +363,17 @@ int followup_guax(struct query *q, struct save_queue *sq, struct validate *v,
            WHERE login = :login;
          if (dbms_errno)
            return mr_errcode;
-         kname = malloc(1);
+         kname = malloc(0);
          status = id_to_name(who, STRINGS_TABLE, &kname);
          si.timestamp = timestamp;
          si.SigInfoVersion = 0; /* XXXXX this isn't used */
          kname_parse(si.pname, si.pinst, si.prealm, kname);
          free(kname);
-         si.rawsig = (unsigned char *)strdup(rsig);
+         si.rawsig = (unsigned char *)xstrdup(rsig);
          GDSS_Recompose(&si, sigbuf);
          free(si.rawsig);
          free(argv[U_SIGNATURE]);
-         argv[U_SIGNATURE] = strdup(sigbuf);
+         argv[U_SIGNATURE] = xstrdup(sigbuf);
        }
 #endif /* GDSS */
       (*action)(q->vcnt, argv, actarg);
@@ -404,12 +402,12 @@ int followup_ausr(struct query *q, char *argv[], client *cl)
   EXEC SQL BEGIN DECLARE SECTION;
   int who, status;
   char *login, *entity, *name;
-  char fullname[129];
+  char fullname[USERS_FIRST_SIZE + USERS_MIDDLE_SIZE + USERS_LAST_SIZE];
   EXEC SQL END DECLARE SECTION;
 #ifdef GDSS
-  char databuf[32];
+  char databuf[USERS_LOGIN_SIZE + USERS_CLEARID_SIZE];
   EXEC SQL BEGIN DECLARE SECTION;
-  char rawsig[128];
+  char rawsig[512];
   int sigwho, timestamp;
   EXEC SQL END DECLARE SECTION;
   SigInfo si;
@@ -499,9 +497,9 @@ int followup_uuac(struct query *q, char *argv[], client *cl)
   char *entity, *name;
   EXEC SQL END DECLARE SECTION;
 #ifdef GDSS
-  char databuf[32];
+  char databuf[USERS_LOGIN_SIZE + USERS_CLEARID_SIZE];
   EXEC SQL BEGIN DECLARE SECTION;
-  char rawsig[128];
+  char rawsig[512];
   char *login;
   int sigwho, timestamp;
   EXEC SQL END DECLARE SECTION;
@@ -515,7 +513,7 @@ int followup_uuac(struct query *q, char *argv[], client *cl)
 #ifdef GDSS
   if (q->vcnt == U_MODTIME && *argv[U_SIGNATURE + 1])
     {
-      login = malloc(1);
+      login = malloc(0);
       status = id_to_name(id, USERS_TABLE, &login);
       sprintf(databuf, "%s:%s", login, argv[U_MITID + 1]);
       free(login);
@@ -670,13 +668,13 @@ int followup_gsnt(struct query *q, struct save_queue *sq, struct validate *v,
        {
          status = 0;
          free(argv[idx]);
-         argv[idx] = strdup("NONE");
+         argv[idx] = xstrdup("NONE");
        }
       else
        {
          status = 0;
          free(argv[idx]);
-         argv[idx] = strdup("???");
+         argv[idx] = xstrdup("???");
        }
       if (status && status != MR_NO_MATCH)
        return status;
@@ -750,13 +748,13 @@ int followup_ghst(struct query *q, struct save_queue *sq, struct validate *v,
        {
          status = 0;
          free(argv[idx]);
-         argv[idx] = strdup("NONE");
+         argv[idx] = xstrdup("NONE");
        }
       else
        {
          status = 0;
          free(argv[idx]);
-         argv[idx] = strdup("???");
+         argv[idx] = xstrdup("???");
        }
       if (status && status != MR_NO_MATCH)
        return status;
@@ -817,20 +815,20 @@ int followup_glin(struct query *q, struct save_queue *sq, struct validate *v,
        {
          status = 0;
          free(argv[idx]);
-         argv[idx] = strdup("NONE");
+         argv[idx] = xstrdup("NONE");
        }
       else
        {
          status = 0;
          free(argv[idx]);
-         argv[idx] = strdup("???");
+         argv[idx] = xstrdup("???");
        }
       if (status && status != MR_NO_MATCH)
        return status;
 
       if (!strcmp(q->shortname, "glin") && atoi(argv[6]) == -1)
        {
-         argv[6] = realloc(argv[6], strlen(UNIQUE_GID) + 1);
+         argv[6] = xrealloc(argv[6], strlen(UNIQUE_GID) + 1);
          strcpy(argv[6], UNIQUE_GID);
        }
 
@@ -887,19 +885,19 @@ int followup_gqot(struct query *q, struct save_queue *sq, struct validate *v,
              break;
            case 'A':
              free(argv[2]);
-             argv[2] = strdup("system:anyuser");
+             argv[2] = xstrdup("system:anyuser");
              break;
            default:
              id = atoi(argv[2]);
-             argv[2] = malloc(8);
+             argv[2] = xmalloc(8);
              sprintf(argv[2], "%d", id);
            }
        }
       id = atoi(argv[idx]);
       free(argv[idx]);
-      argv[idx] = malloc(256);
+      argv[idx] = xmalloc(id ? NFSPHYS_DIR_SIZE : FILESYS_NAME_SIZE);
       name = argv[idx];
-      memset(name, 0, 256);
+      name[0] = '\0';
       if (id == 0)
        {
          label = argv[0];
@@ -1138,13 +1136,13 @@ int followup_gzcl(struct query *q, struct save_queue *sq, struct validate *v,
            {
              status = 0;
              free(argv[i + 1]);
-             argv[i + 1] = strdup("NONE");
+             argv[i + 1] = xstrdup("NONE");
            }
          else
            {
              status = 0;
              free(argv[i + 1]);
-             argv[i + 1] = strdup("???");
+             argv[i + 1] = xstrdup("???");
            }
          if (status && status != MR_NO_MATCH)
            return status;
@@ -1196,13 +1194,13 @@ int followup_gsha(struct query *q, struct save_queue *sq, struct validate *v,
        {
          status = 0;
          free(argv[2]);
-         argv[2] = strdup("NONE");
+         argv[2] = xstrdup("NONE");
        }
       else
        {
          status = 0;
          free(argv[2]);
-         argv[2] = strdup("???");
+         argv[2] = xstrdup("???");
        }
       if (status && status != MR_NO_MATCH)
        return status;
@@ -1234,7 +1232,7 @@ int _sdl_followup(struct query *q, char *argv[], client *cl)
 int trigger_dcm(struct query *q, char *argv[], client *cl)
 {
   pid_t pid;
-  char prog[128];
+  char prog[MAXPATHLEN];
 
   sprintf(prog, "%s/startdcm", BIN_DIR);
   pid = vfork();
index d848ad63aeeac00b697e1a16e0729922162f3e26..acafef3557bb0c632139bafa28bc52a4ce53d4f5 100644 (file)
@@ -3,7 +3,6 @@
  *  Used by the SQL query routines of the Moira server.
  */
 
-#define MR_CDUMMY_LEN  256
 #define MR_STMTBUF_LEN 1024
 
 extern int mr_sig_length;
index ddf924be57ed9f5daeb201c3d1103bee5bb12ba6..217c9e830c530e4e7235902c83deec590f9bf83e 100644 (file)
@@ -25,8 +25,6 @@ RCSID("$Header$");
 SQLDA *mr_sqlda;
 EXEC SQL BEGIN DECLARE SECTION;
 int mr_sig_length;
-int idummy;
-char cdummy[MR_CDUMMY_LEN];
 char stmt_buf[MR_STMTBUF_LEN];
 EXEC SQL END DECLARE SECTION;
 
@@ -96,7 +94,7 @@ int mr_open_database(void)
 
       /* initialize local argv */
       for (i = 0; i < 16; i++)
-       Argv[i] = malloc(ARGLEN);
+       Argv[i] = xmalloc(MAX_FIELD_WIDTH);
 
       mr_sqlda = mr_alloc_sqlda();
 
@@ -386,7 +384,7 @@ out:
          EXEC SQL COMMIT WORK;
          if (journal)
            {
-             char buf[1024];
+             char *buf;
              int i;
              extern time_t now;
 
@@ -397,8 +395,9 @@ out:
                {
                  if (i != 0)
                    putc(' ', journal);
-                 requote(buf, argv_ro[i], sizeof(buf));
+                 buf = requote(argv_ro[i]);
                  fputs(buf, journal);
+                 free(buf);
                }
              putc('\n', journal);
              fflush(journal);
@@ -513,7 +512,7 @@ int mr_verify_query(client *cl, struct query *q, int argc, char *argv_ro[])
   /* copy the arguments into a local argv that we can modify */
   for (i = 0; i < argc; i++)
     {
-      for (to = Argv[i], fr = argv_ro[i], stop = to + ARGLEN; (*fr) && (to < stop);)
+      for (to = Argv[i], fr = argv_ro[i], stop = to + MAX_FIELD_WIDTH; (*fr) && (to < stop);)
        *to++ = *fr++;
 
       if (*fr)
@@ -976,7 +975,7 @@ void dosql(char *buffers[])
     {
       mr_sqlda->V[i] = buffers[i];
       mr_sqlda->T[i] = 97;
-      mr_sqlda->L[i] = ARGLEN;
+      mr_sqlda->L[i] = MAX_FIELD_WIDTH;
     }
   EXEC SQL FETCH inc_crs USING DESCRIPTOR mr_sqlda;
 
@@ -1016,7 +1015,7 @@ int do_for_all_rows(char *query, int count,
     {
       mr_sqlda->V[i] = sqlbuffer[i];
       mr_sqlda->T[i] = 97;
-      mr_sqlda->L[i] = ARGLEN;
+      mr_sqlda->L[i] = MAX_FIELD_WIDTH;
     }
 
   while (1)
index 68785888cdb19813f7d121f148bba74930aac476..c76544da37c9f766098e9955df306e66a8f44925 100644 (file)
@@ -132,7 +132,7 @@ int setup_spop(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int id, mid;
-  char type[9];
+  char type[USERS_POTYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
 
   id = *(int *)argv[0];
@@ -156,7 +156,7 @@ int setup_dpob(struct query *q, char *argv[], client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int id, user;
-  char type[9];
+  char type[USERS_POTYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
 
   user = *(int *)argv[0];
@@ -497,7 +497,7 @@ int setup_afil(struct query *q, char *argv[], client *cl)
   int mach_id;
   EXEC SQL BEGIN DECLARE SECTION;
   int ok;
-  char ftype[32], *rwaccess;
+  char ftype[FILESYS_TYPE_SIZE + 10], *rwaccess;
   EXEC SQL END DECLARE SECTION;
 
   type = argv[1];
@@ -535,7 +535,7 @@ int setup_ufil(struct query *q, char *argv[], client *cl)
   char *type, *name;
   EXEC SQL BEGIN DECLARE SECTION;
   int fid, total, who, ok;
-  char *entity, ftype[32], *access;
+  char *entity, ftype[FILESYS_TYPE_SIZE + 10], *access;
   short int total_null;
   EXEC SQL END DECLARE SECTION;
 
@@ -608,7 +608,7 @@ int setup_ufil(struct query *q, char *argv[], client *cl)
 int check_nfs(int mach_id, char *name, char *access)
 {
   EXEC SQL BEGIN DECLARE SECTION;
-  char dir[81];
+  char dir[NFSPHYS_DIR_SIZE];
   int mid = mach_id;
   EXEC SQL END DECLARE SECTION;
   int status;
@@ -849,7 +849,8 @@ int prefetch_filesys(struct query *q, char **argv, client *cl)
 int setup_ahst(struct query *q, char **argv, client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
-  char *name, oldname[41], vendor[17], model[25], os[17];
+  char *name, oldname[MACHINE_NAME_SIZE], vendor[MACHINE_VENDOR_SIZE];
+  char *model[MACHINE_MODEL_SIZE], os[MACHINE_OS_SIZE];
   int value, id, saddr, mask, high, low, cnt;
   EXEC SQL END DECLARE SECTION;
   int row;
index e26643d9da718fbc42e67ea9fbd97902e81bf7d7..36dfe049ed9eca165ee55239039d515788f6da69 100644 (file)
@@ -61,7 +61,7 @@ void list_queries(int (*action)(int, char *[], void *), void *actarg)
   count = QueryCount2;
   if (!squeries2)
     {
-      sq = malloc(count * sizeof(struct query *));
+      sq = xmalloc(count * sizeof(struct query *));
       squeries2 = sq;
       q = Queries2;
       for (i = count; --i >= 0; )
index 42ca9afbf29cf5cecd09720eae2b3b51869b4b3b..7d4647fc0afa33e8fc1701bf864459b8afebb3d1 100644 (file)
@@ -51,7 +51,7 @@ int set_pobox(struct query *q, char **argv, client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int user, id;
-  char *box, potype[9];
+  char *box, potype[USERS_POTYPE_SIZE];
   EXEC SQL END DECLARE SECTION;
   int status;
 
@@ -113,9 +113,11 @@ int get_list_info(struct query *q, char **aargv, client *cl,
 {
   char *argv[13];
   EXEC SQL BEGIN DECLARE SECTION;
-  char *name, acl_type[9], listname[33], active[5], public[5], hidden[5];
-  char maillist[5], grouplist[5], gid_str[6], desc[256];
-  char modtime[27], modwith[9];
+  char *name, acl_type[LIST_ACL_TYPE_SIZE], listname[LIST_NAME_SIZE];
+  char active[5], public[5], hidden[5];
+  char maillist[5], grouplist[5], gid_str[LIST_GID_SIZE];
+  char desc[LIST_DESCRIPTION_SIZE], modtime[LIST_MODTIME_SIZE];
+  char modwith[LIST_MODWITH_SIZE];
   int id, rowcount, acl_id, hid, modby_id;
   EXEC SQL END DECLARE SECTION;
   int returned, status;
@@ -184,13 +186,13 @@ int get_list_info(struct query *q, char **aargv, client *cl,
        {
          status = 0;
          free(argv[8]);
-         argv[8] = strdup("NONE");
+         argv[8] = xstrdup("NONE");
        }
       else
        {
          status = 0;
          free(argv[8]);
-         argv[8] = strdup("???");
+         argv[8] = xstrdup("???");
        }
       if (status && status != MR_NO_MATCH)
        return status;
@@ -227,7 +229,7 @@ int add_member_to_list(struct query *q, char **argv, client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int id, lid, mid, error, who, ref, rowcnt;
-  char *mtype, dtype[9], *entity;
+  char *mtype, dtype[IMEMBERS_MEMBER_TYPE_SIZE], *entity;
   EXEC SQL END DECLARE SECTION;
   int ancestors[MAXLISTDEPTH], aref[MAXLISTDEPTH], acount, a;
   int descendants[MAXLISTDEPTH], dref[MAXLISTDEPTH], dcount, d;
@@ -409,7 +411,7 @@ int delete_member_from_list(struct query *q, char **argv, client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int id, lid, mid, cnt, error, who, ref;
-  char *mtype, dtype[9], *entity;
+  char *mtype, dtype[IMEMBERS_MEMBER_TYPE_SIZE], *entity;
   EXEC SQL END DECLARE SECTION;
   int ancestors[MAXLISTDEPTH], aref[MAXLISTDEPTH], acount, a;
   int descendants[MAXLISTDEPTH], dref[MAXLISTDEPTH], dcount, d;
@@ -681,7 +683,7 @@ int get_ace_internal(char *atype, int aid,
   char *rargv[2];
   int found = 0;
   EXEC SQL BEGIN DECLARE SECTION;
-  char name[33], *type = atype;
+  char name[LIST_NAME_SIZE], *type = atype;
   int id = aid;
   EXEC SQL END DECLARE SECTION;
 
@@ -850,7 +852,8 @@ int get_lists_of_member(struct query *q, char *argv[], client *cl,
   EXEC SQL BEGIN DECLARE SECTION;
   char *atype;
   int aid;
-  char name[33], active[5], public[5], hidden[5], maillist[5], grouplist[5];
+  char name[LIST_NAME_SIZE];
+  char active[5], public[5], hidden[5], maillist[5], grouplist[5];
   EXEC SQL END DECLARE SECTION;
 
   atype = argv[0];
@@ -984,7 +987,7 @@ int gmol_internal(struct query *q, char *argv[], client *cl,
 {
   EXEC SQL BEGIN DECLARE SECTION;
   int list_id, direct;
-  char member_name[129];
+  char member_name[MAX_FIELD_WIDTH];
   EXEC SQL END DECLARE SECTION;
   char *targv[2];
 
@@ -1218,7 +1221,8 @@ int qualified_get_serverhost(struct query *q, char *argv[], client *cl,
 int register_user(struct query *q, char **argv, client *cl)
 {
   EXEC SQL BEGIN DECLARE SECTION;
-  char *login, *entity, directory[129], machname[33];
+  char *login, *entity;
+  char directory[FILESYS_NAME_SIZE], machname[MACHINE_NAME_SIZE];
   int who, rowcount, mid, uid, users_id, utype, list_id;
   int ostatus, nstatus, fsidval;
   static int m_id = 0, def_quota = 0;
index 58f05050880c71bab00731fa5b98a44bf8704ca9..14081fd8ee4f9e6d9a3a28a2a9f657cc8296c291 100644 (file)
@@ -68,16 +68,6 @@ static char UID[] = "unix_uid";
 static char ZEPH[] = "zephyr";
 static char ZEPH_ID[] = "xmt_id";
 
-/* Table Names */
-char *table_name[] = {
-  "none", USERS, "krbmap", MACHINE, "hostalias", SUBNET, CLUSTER,
-  "mcmap", "svc", LIST, "imembers", SERVERS, "serverhosts", FILESYS,
-  "fsgroup", "nfsphys", "quota", ZEPH, HOSTACCESS, "strings", "services",
-  PRINTCAP, "palladium", "capacls", "alias", "numvalues", "tblstats",
-  "incremental"};
-int num_tables = 27;
-
-
 /* VALOBJS
  * These are commonly used validation objects, defined here so that they
  * can be shared.
@@ -149,7 +139,7 @@ static struct valobj VOmach0[] = {
 };
 
 static struct valobj VOclu0[] = {
-  {V_ID, 0, CLUSTER_TABLE, NAME, CLU_ID, MR_CLUSTER},
+  {V_ID, 0, CLUSTERS_TABLE, NAME, CLU_ID, MR_CLUSTER},
 };
 
 static struct valobj VOlist0[] = {
@@ -1062,10 +1052,10 @@ static char *aclu_fields[] = {
 };
 
 static struct valobj aclu_valobj[] = {
-  {V_LOCK, 0, CLUSTER_TABLE, 0, CLU_ID, MR_DEADLOCK},
-  {V_CHAR, 0, CLUSTER_TABLE, NAME},
-  {V_LEN, 1, CLUSTER_TABLE, DESC},
-  {V_LEN, 2, CLUSTER_TABLE, LOCATION},
+  {V_LOCK, 0, CLUSTERS_TABLE, 0, CLU_ID, MR_DEADLOCK},
+  {V_CHAR, 0, CLUSTERS_TABLE, NAME},
+  {V_LEN, 1, CLUSTERS_TABLE, DESC},
+  {V_LEN, 2, CLUSTERS_TABLE, LOCATION},
 };
 
 static struct validate aclu_validate =
@@ -1087,11 +1077,11 @@ static char *uclu_fields[] = {
 };
 
 static struct valobj uclu_valobj[] = {
-  {V_LOCK, 0, CLUSTER_TABLE, 0, CLU_ID, MR_DEADLOCK},
-  {V_ID, 0, CLUSTER_TABLE, NAME, CLU_ID, MR_CLUSTER},
-  {V_RENAME, 1, CLUSTER_TABLE, NAME, CLU_ID, MR_NOT_UNIQUE},
-  {V_LEN, 2, CLUSTER_TABLE, DESC},
-  {V_LEN, 3, CLUSTER_TABLE, LOCATION},
+  {V_LOCK, 0, CLUSTERS_TABLE, 0, CLU_ID, MR_DEADLOCK},
+  {V_ID, 0, CLUSTERS_TABLE, NAME, CLU_ID, MR_CLUSTER},
+  {V_RENAME, 1, CLUSTERS_TABLE, NAME, CLU_ID, MR_NOT_UNIQUE},
+  {V_LEN, 2, CLUSTERS_TABLE, DESC},
+  {V_LEN, 3, CLUSTERS_TABLE, LOCATION},
 };
 
 static struct validate uclu_validate = {
@@ -1140,7 +1130,7 @@ static struct validate gmcm_validate = { gmcm_valobj, 4 };
 static struct valobj amtc_valobj[] =   /* ADD_MACHINE_TO_CLUSTER */
 {                                      /* DELETE_MACHINE_FROM_CLUSTER */
   {V_ID, 0, MACHINE_TABLE, NAME, MACH_ID, MR_MACHINE},
-  {V_ID, 1, CLUSTER_TABLE, NAME, CLU_ID, MR_CLUSTER},
+  {V_ID, 1, CLUSTERS_TABLE, NAME, CLU_ID, MR_CLUSTER},
 };
 
 static struct validate amtc_validate = /* for amtc and dmfc */
@@ -1167,7 +1157,7 @@ static char *acld_fields[] = {
 
 static struct valobj acld_valobj[] =
 {
-  {V_ID, 0, CLUSTER_TABLE, NAME, CLU_ID, MR_CLUSTER},
+  {V_ID, 0, CLUSTERS_TABLE, NAME, CLU_ID, MR_CLUSTER},
   {V_CHAR, 1, SVC_TABLE, "serv_label"},
   {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
 };
@@ -1187,7 +1177,7 @@ static struct validate acld_validate =
 
 static struct valobj dcld_valobj[] =
 {
-  {V_ID, 0, CLUSTER_TABLE, NAME, CLU_ID, MR_CLUSTER},
+  {V_ID, 0, CLUSTERS_TABLE, NAME, CLU_ID, MR_CLUSTER},
 };
 
 static struct validate dcld_validate =
@@ -3340,7 +3330,7 @@ struct query Queries2[] = {
     "gclu",
     RETRIEVE,
     "c",
-    CLUSTER_TABLE,
+    CLUSTERS_TABLE,
     "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
     gclu_fields,
     6,
@@ -3355,7 +3345,7 @@ struct query Queries2[] = {
     "aclu",
     APPEND,
     "c",
-    CLUSTER_TABLE,
+    CLUSTERS_TABLE,
     "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
     aclu_fields,
     3,
@@ -3370,7 +3360,7 @@ struct query Queries2[] = {
     "uclu",
     UPDATE,
     "c",
-    CLUSTER_TABLE,
+    CLUSTERS_TABLE,
     "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
     uclu_fields,
     3,
@@ -3385,7 +3375,7 @@ struct query Queries2[] = {
     "dclu",
     DELETE,
     "c",
-    CLUSTER_TABLE,
+    CLUSTERS_TABLE,
     NULL,
     dclu_fields,
     0,
index ee5c05afc9b3ca976e8c086877a629c506d744ef..caba845df47643d13144532423bd069c81c504f2 100644 (file)
 /* Query Types */
 enum query_type {RETRIEVE, UPDATE, APPEND, DELETE, SPECIAL};
 
-/* Tables */
-enum tables {NO_TABLE, USERS_TABLE, KRBMAP_TABLE, MACHINE_TABLE,
-            HOSTALIAS_TABLE, SUBNET_TABLE, CLUSTER_TABLE, MCMAP_TABLE,
-            SVC_TABLE, LIST_TABLE, IMEMBERS_TABLE, SERVERS_TABLE,
-            SERVERHOSTS_TABLE, FILESYS_TABLE, FSGROUP_TABLE, NFSPHYS_TABLE,
-            QUOTA_TABLE, ZEPHYR_TABLE, HOSTACCESS_TABLE, STRINGS_TABLE,
-            SERVICES_TABLE, PRINTCAP_TABLE, PALLADIUM_TABLE, CAPACLS_TABLE,
-            ALIAS_TABLE, NUMVALUES_TABLE, TBLSTATS_TABLE, INCREMENTAL_TABLE};
-
 /* Query Definition Structure */
 struct query
 {
index 797980f63cb96df6030c0fa3005299b4b12906f3..532a2a7e64bcdf1990c291ae1445c62fc0e15afa 100644 (file)
@@ -209,7 +209,7 @@ int validate_id(struct query *q, char *argv[], struct valobj *vo)
 
   if ((tbl == USERS_TABLE && !strcmp(namefield, "login")) ||
       tbl == MACHINE_TABLE || tbl == SUBNET_TABLE || tbl == FILESYS_TABLE ||
-      tbl == LIST_TABLE || tbl == CLUSTER_TABLE || tbl == STRINGS_TABLE)
+      tbl == LIST_TABLE || tbl == CLUSTERS_TABLE || tbl == STRINGS_TABLE)
     {
       if (tbl == MACHINE_TABLE || tbl == SUBNET_TABLE)
        {
@@ -566,7 +566,7 @@ SQLDA *mr_alloc_sqlda(void)
 
   for (j = 0; j < QMAXARGS; j++)
     {
-      it->V[j] = sqlbuffer[j] = malloc(ARGLEN);
+      it->V[j] = sqlbuffer[j] = xmalloc(ARGLEN);
       it->T[j] = 97; /* 97 = CHARZ = null-terminated string */
       it->L[j] = ARGLEN;
     }
This page took 0.127824 seconds and 5 git commands to generate.