1. 14 4月, 2019 2 次提交
    • Sebastian Kemper's avatar
      FS-11783: [mod_say_ja] quiet overflow warning · 3ca75eb8
      Sebastian Kemper 提交于
      With -Wformat-overflow gcc warns about calls to formatted input/output
      function "sprintf" that might overflow the destination buffer.
      
      In this case gcc does not know the upper bound of tm_min and assumes
      that up to 11 bytes might be written to buffer (3 bytes). But we know
      that tm_min can only be within the range 0 to 59.
      
      mod_say_ja.c: In function 'ja_say_time':
      mod_say_ja.c:376:35: error: '%d' directive writing between 2 and 10 bytes into a region of size 3 [-Werror=format-overflow=]
                        sprintf(buffer, "%d", tm.tm_min);
                                         ^~
      mod_say_ja.c:376:34: note: directive argument in the range [11, 2147483647]
                        sprintf(buffer, "%d", tm.tm_min);
                                        ^~~~
      mod_say_ja.c:376:18: note: 'sprintf' output between 3 and 11 bytes into a destination of size 3
                        sprintf(buffer, "%d", tm.tm_min);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This commits adds a hint for gcc, which silences the warning.
      Signed-off-by: 's avatarSebastian Kemper <sebastian_ml@gmx.net>
      3ca75eb8
    • Sebastian Kemper's avatar
      FS-11783: [core] quiet gcc truncation warning · e114c638
      Sebastian Kemper 提交于
      With -Wstringop-truncation gcc warns about calls to bounded string
      manipulation function "strncpy" that may either truncate the copied
      string or leave the destination unchanged. To avoid the warning when the
      result is not expected to be NUL-terminated, it is suggested to call
      "memcpy" instead.
      
      src/switch_core_media.c: In function 'switch_core_media_patch_sdp':
      src/switch_core_media.c:11854:4: error: 'strncpy' output truncated before terminating nul copying 2 bytes from a string of the same length [-Werror=stringop-truncation]
          strncpy(q, strchr(a_engine->adv_sdp_ip, ':') ? "6 " : "4 ", 2);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      This commit follows gcc's recommendation.
      Signed-off-by: 's avatarSebastian Kemper <sebastian_ml@gmx.net>
      e114c638
  2. 05 4月, 2019 1 次提交
  3. 03 4月, 2019 4 次提交
  4. 02 4月, 2019 2 次提交
  5. 01 4月, 2019 3 次提交
  6. 31 3月, 2019 3 次提交
  7. 29 3月, 2019 1 次提交
  8. 27 3月, 2019 5 次提交
  9. 26 3月, 2019 7 次提交
  10. 20 3月, 2019 1 次提交
  11. 19 3月, 2019 2 次提交
  12. 15 3月, 2019 1 次提交
  13. 12 3月, 2019 1 次提交
  14. 09 3月, 2019 3 次提交
  15. 08 3月, 2019 1 次提交
  16. 07 3月, 2019 3 次提交