#1945 Enable printf format string checking in function debug_fn
Closed: Fixed None Opened 6 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

2 years ago

Login to comment on this ticket.

Metadata