Skip to content

Brakeman crashes while printing warning for Ruby EOL 2.6 #1671

Closed
@klazuka

Description

@klazuka

Earlier this morning we started seeing Brakeman crash with error:

gems/brakeman-5.2.0/lib/brakeman/warning.rb:251:in `sprintf': can't convert nil into Integer (TypeError)

I traced the error and found that it crashed while reporting a warning for CheckEOLRuby. The root cause appears to be that the warning symbol :pending_eol_ruby was introduced recently here in #1660, but never had a numeric code registered.

I was able to fix the problem by editing https://github.com/presidentbeef/brakeman/blob/main/lib/brakeman/warning_codes.rb to assign :pending_eol_ruby a numeric code.

Activity

presidentbeef

presidentbeef commented on Jan 30, 2022

@presidentbeef
Owner

Ah, embarrassing. I'll get a fix out ASAP.

added a commit that references this issue on Jan 30, 2022
3963964
added a commit that references this issue on Jan 30, 2022
1f95449
presidentbeef

presidentbeef commented on Jan 30, 2022

@presidentbeef
Owner

Fixed with 5.2.1. Thanks and apologies!

klazuka

klazuka commented on Jan 30, 2022

@klazuka
Author

@presidentbeef no problem. Thanks for the quick fix!

Repository owner locked and limited conversation to collaborators on Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @presidentbeef@klazuka

      Issue actions

        Brakeman crashes while printing warning for Ruby EOL 2.6 · Issue #1671 · presidentbeef/brakeman