Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid references in modules #18225

Merged

Conversation

adfoster-r7
Copy link
Contributor

@adfoster-r7 adfoster-r7 commented Jul 27, 2023

Fixes multiple missing/invalid references in modules

Spotted as part of reviewing #18225

I applied this patch locally to log out the invalid modules, but we should probably have this wired up better for catching future mistakes

diff --git a/lib/msf/core/module/module_info.rb b/lib/msf/core/module/module_info.rb
index 7bae76896d..6b0783369b 100644
--- a/lib/msf/core/module/module_info.rb
+++ b/lib/msf/core/module/module_info.rb
@@ -69,6 +69,7 @@ module Msf::Module::ModuleInfo
     if(refs and not refs.empty?)
       refs.each_index do |i|
         if !(refs[i].respond_to?('[]') and refs[i].length == 2)
+          $stderr.puts "invalid #{self.method(:initialize).source_location[0]} refs! #{refs.inspect}"
           refs[i] = nil
         end
       end

Verification

  • Verify CI passes
  • Verify the changes make sense

@cgranleese-r7 cgranleese-r7 self-assigned this Jul 27, 2023
@cgranleese-r7 cgranleese-r7 added the rn-fix release notes fix label Jul 27, 2023
@cgranleese-r7 cgranleese-r7 merged commit 055206a into rapid7:master Jul 27, 2023
34 checks passed
@cgranleese-r7
Copy link
Contributor

Release Notes

This PR fixes multiple missing/invalid references in modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn-fix release notes fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants