return NULL;
 }
 
+/* needs at least dlm_rcom + rcom_lock */
 static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
                                  struct dlm_rsb *r, struct dlm_rcom *rc)
 {
    the given values and send back our lkid.  We send back our lkid by sending
    back the rcom_lock struct we got but with the remid field filled in. */
 
+/* needs at least dlm_rcom + rcom_lock */
 int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
 {
        struct rcom_lock *rl = (struct rcom_lock *) rc->rc_buf;
        return error;
 }
 
+/* needs at least dlm_rcom + rcom_lock */
 int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
 {
        struct rcom_lock *rl = (struct rcom_lock *) rc->rc_buf;
 
        return error;
 }
 
+/* needs at least dlm_rcom + rcom_lock */
 static void receive_rcom_lock(struct dlm_ls *ls, struct dlm_rcom *rc_in)
 {
        struct dlm_rcom *rc;
 
 void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
 {
+       int lock_size = sizeof(struct dlm_rcom) + sizeof(struct rcom_lock);
+
        if (dlm_recovery_stopped(ls) && (rc->rc_type != DLM_RCOM_STATUS)) {
                log_debug(ls, "ignoring recovery message %x from %d",
                          rc->rc_type, nodeid);
                break;
 
        case DLM_RCOM_LOCK:
+               if (rc->rc_header.h_length < lock_size)
+                       goto Eshort;
                receive_rcom_lock(ls, rc);
                break;
 
                break;
 
        case DLM_RCOM_LOCK_REPLY:
+               if (rc->rc_header.h_length < lock_size)
+                       goto Eshort;
                dlm_recover_process_copy(ls, rc);
                break;
 
        default:
                log_error(ls, "receive_rcom bad type %d", rc->rc_type);
        }
- out:
+out:
        return;
+Eshort:
+       log_error(ls, "recovery message %x from %d is too short",
+                         rc->rc_type, nodeid);
 }