[Bug 1562] New: EXPAND_MAX_KEYS in percent_expand is actually (EXPAND_MAX_KEYS - 1)

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Feb 26 02:27:55 EST 2009


https://bugzilla.mindrot.org/show_bug.cgi?id=1562

           Summary: EXPAND_MAX_KEYS in percent_expand is actually
                    (EXPAND_MAX_KEYS - 1)
           Product: Portable OpenSSH
           Version: 5.2p1
          Platform: Other
        OS/Version: Solaris
            Status: NEW
          Severity: minor
          Priority: P4
         Component: Miscellaneous
        AssignedTo: unassigned-bugs at mindrot.org
        ReportedBy: Jan.Pechanec at Sun.COM


Created an attachment (id=1607)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1607)
suggested patch

it may be a nit picking: EXPAND_MAX_KEYS, as any MAX macro, suggests
that we can have up to EXPAND_MAX_KEYS keys. That's not true since if
we reach the maximum, the following test bails out:

        if (num_keys >= EXPAND_MAX_KEYS)
                fatal("percent_expand: too many keys");

it's not a problem here since 16 becomes 15 which is still large enough
but the issue is there anyway. I'm attaching a patch. In the patch
changes, two "==" strings can be changed to ">=" if you feel it's
better in terms of possible future updates. However, "==" is enough
there.

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list