Bug 1562 - EXPAND_MAX_KEYS in percent_expand is actually (EXPAND_MAX_KEYS - 1)
Summary: EXPAND_MAX_KEYS in percent_expand is actually (EXPAND_MAX_KEYS - 1)
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 5.2p1
Hardware: Other Solaris
: P4 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_4
  Show dependency treegraph
 
Reported: 2009-02-26 02:27 AEDT by Jan Pechanec
Modified: 2010-03-26 10:51 AEDT (History)
1 user (show)

See Also:


Attachments
suggested patch (881 bytes, patch)
2009-02-26 02:27 AEDT, Jan Pechanec
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pechanec 2009-02-26 02:27:54 AEDT
Created attachment 1607 [details]
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.
Comment 1 Damien Miller 2009-11-20 14:24:23 AEDT
patch applied, will be in openssh-5.4
Comment 2 Darren Tucker 2010-03-26 10:51:23 AEDT
With the release of 5.4p1, this bug is now considered closed.