[Issue 23648] New: Replace all sprintf with snprintf

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 22 20:21:22 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23648

          Issue ID: 23648
           Summary: Replace all sprintf with snprintf
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: johanengelen at weka.io

sprintf may write beyond the buffer passed, snprintf is the safer option.

Recent Clang compiler by default warns on the use of sprintf (deprecated) for
the c++ part of LDC. It'd be good to also remove it from D code. The fix is
usually not so hard.

--


More information about the Digitalmars-d-bugs mailing list