Modules/UDI - Add check for UDI_VERSION to udi.h
[tpg/acess2.git] / KernelLand / Modules / Interfaces / UDI / udi_lib / core / cb.c
index 7834cf3..9bf8f11 100644 (file)
@@ -150,8 +150,9 @@ void udi_cb_alloc_batch(
                {
                        if( *layout == UDI_DL_BUF ) {
                                if( buf_ofs ) {
-                                       Log_Notice("UDI", "TODO Multiple buffers in cb_alloc_batch (%s:%i)",
-                                               metalang->Name, cb_init->meta_cb_num);
+                                       Log_Notice("UDI", "TODO Multiple buffers in cb_alloc_batch (%s:%i, %s:%i)",
+                                               metalang->Name, cb_init->meta_cb_num,
+                                               inst->Module->ModuleName, cb_idx);
                                }
                                buf_ofs = cur_ofs;
                        }
@@ -159,7 +160,14 @@ void udi_cb_alloc_batch(
                                // No-op        
                        }
                        
-                       cur_ofs += _udi_marshal_step(NULL, 0, &layout, NULL);
+                       size_t  sz = _udi_marshal_step(NULL, 0, &layout, NULL);
+                       if( sz == 0 ) {
+                               Log_Warning("UDI", "Metalang CB %s:%i has an invalid layout",
+                                       metalang->Name, cb_init->meta_cb_num);
+                               callback(gcb, NULL);
+                               return ;
+                       }
+                       cur_ofs += sz;
                }
        }
 

UCC git Repository :: git.ucc.asn.au