Bug 13142 - samba-4.7.2/source3/utils/net_idmap.c: 2 * bad width ?
Summary: samba-4.7.2/source3/utils/net_idmap.c: 2 * bad width ?
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.7.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-15 14:14 UTC by David Binderman
Modified: 2019-06-24 07:54 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2017-11-15 14:14:04 UTC
1.
samba-4.7.2/source3/utils/net_idmap.c:420]: (error) Width 128 given in format string (no. 2) is larger than destination buffer 'sid_string[128]', use %127s to prevent overflowing it.

Source code is

       if (sscanf(line, "GID %lu %128s", &idval, sid_string) == 2)

Maybe better code:

       if (sscanf(line, "GID %lu %127s", &idval, sid_string) == 2)

2.

[samba-4.7.2/source3/utils/net_idmap.c:427]: (error) Width 128 given in format string (no. 2) is larger than destination buffer 'sid_string[128]', use %127s to prevent overflowing it.

Duplicate.
Comment 1 Amit Kumar 2019-06-24 07:30:11 UTC
(In reply to David Binderman from comment #0)
Its already set to
(sscanf(line, "GID %lu %127s", &idval, sid_string) == 2)
in samba-4.10.4