]> andersk Git - moira.git/blobdiff - gdb/gdb_ops.c
avoid coredump bug with nULL strings
[moira.git] / gdb / gdb_ops.c
index 42056da973cce1dd1b7d9733d6e2f56a4e986953..449feec61f642868878813c4ab284fe09afd7ecd 100644 (file)
@@ -222,6 +222,7 @@ struct obj_data *arg;
        /*      
        /*----------------------------------------------------------*/
 
+/*ARGSUSED*/
 int
 g_csnobj(op, hcon, arg)
 OPERATION op;
@@ -431,8 +432,12 @@ struct robj_data *arg;
         * to local byte order, and allocate the space for the receive.
         */
        arg->len = (int) ntohl((u_long)arg->len);
+       if (arg->len > 65536)
+         return OP_CANCELLED;
 
        arg->flattened = db_alloc(arg->len);
+       if (arg->flattened == NULL)
+         return OP_CANCELLED;
        /*
         * Now start receiving the encoded object itself.  If it all comes in
         * synchronously, then just go on to the c2 routine to decode it and
@@ -571,7 +576,7 @@ struct lis_data {
 int g_ilis();
 int g_clis();
 
-int
+void
 gdb_start_listening(op, con, otherside, lenp, fdp)
 OPERATION op;
 CONNECTION con;
@@ -653,6 +658,7 @@ struct lis_data *arg;
        /*      
        /*----------------------------------------------------------*/
 
+/*ARGSUSED*/
 int
 g_clis(op, hcon, arg)
 OPERATION op;
@@ -708,7 +714,7 @@ struct acc_data {
 int g_iacc();
 int g_i2acc();
 
-int
+void
 start_accepting_client(listencon, op, conp, otherside, lenp, tuplep)
 CONNECTION listencon;
 OPERATION op;
@@ -770,6 +776,7 @@ TUPLE *tuplep;
        /*      
        /*----------------------------------------------------------*/
 
+/*ARGSUSED*/
 int
 g_iacc(op, hcon, arg)
 OPERATION op;
@@ -874,6 +881,7 @@ struct acc_data *arg;
        /*      
        /*----------------------------------------------------------*/
 
+/*ARGSUSED*/
 int
 g_i2acc(op, hcon, arg)
 OPERATION op;
This page took 0.033513 seconds and 4 git commands to generate.