From a145ef09b12ca2f36a2f9800d5bc9c1b45351e29 Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Thu, 21 Nov 2024 16:36:29 -0500 Subject: [PATCH] Fix two fields in UserProperties --- lib/ruby_smb/dcerpc/samr.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ruby_smb/dcerpc/samr.rb b/lib/ruby_smb/dcerpc/samr.rb index 00f1633c..44db53bc 100644 --- a/lib/ruby_smb/dcerpc/samr.rb +++ b/lib/ruby_smb/dcerpc/samr.rb @@ -443,8 +443,8 @@ class UserProperties < BinData::Record uint16 :reserved3 string :reserved4, length: 96 uint16 :property_signature, initial_value: 0x50 - uint16 :property_count, initial_value: -> { user_properties.size } - array :user_properties, type: :user_property, initial_length: :property_count + uint16 :property_count, initial_value: -> { user_properties.size }, onlyif: -> { struct_length > 111 } + array :user_properties, type: :user_property, initial_length: :property_count, onlyif: :property_count? uint8 :reserved5 end