#1945 Enable printf format string checking in function debug_fn
Closed: Fixed None Opened 10 years ago by lslebodn.

Function debug_fn is indirectly used in DEBUG macro.
All arguments should be type-checked against a format string.
So it would not be possible to forget argument(s) or to pass argument with different type (may cause segfault)


critical format string issues fixed in master: 7486dea

  • missing arguments.
  • format '%s', but argument is integer.
  • wrong format string, example: '%\n'

Patch enables printf format string checking in function debug_fn
attribute_format.patch

There left 149 warnings after fixing critical issues.
Warnings will be visible after applying patch attribute_format.patch​. These are mostly incorrect integer formatting

Example:[[BR]]
warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int'

  • format should be changed to '%ld'[[BR]]

warning: format '%d' expects argument of type 'int', but argument 2 has type 'size_t'

  • c99 standard says 'z' modifier should be used -> format should be '%zu'

_comment0: There left 149 warnings after fixing critical issues.
Warnings will be visible after applying patch attribute_format.patch​. These are mostly incorrect integer formatting

Example:[[BR]]
warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int'
format should be changed to '%ld'[[BR]]
warning: format '%d' expects argument of type 'int', but argument 2 has type 'size_t'
c99 standard says 'z' modifier should be used -> format should be '%zd' => 1374668894784210

Fields changed

keywords: => easyfix
milestone: NEEDS_TRIAGE => SSSD 1.12 beta
rhbz: => 0

Fields changed

changelog: =>
owner: somebody => lslebodn
patch: 0 => 1
status: new => assigned

Fields changed

milestone: SSSD 1.13 beta => Interim Bucket
priority: trivial => major

Fields changed

milestone: Interim Bucket => SSSD 1.12 beta

Fixed with fc6afb0..aac0718

milestone: SSSD 1.12 beta => SSSD 1.11.1
resolution: => fixed
status: assigned => closed

Metadata Update from @lslebodn:
- Issue assigned to lslebodn
- Issue set to the milestone: SSSD 1.11.1

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/2987

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata