Summary: | ASTERISK-27576: [patch] res_config_pgsql: Avoid typecasting an int to unsigned char. | ||||
Reporter: | Alexander Traud (traud) | Labels: | patch | ||
Date Opened: | 2018-01-12 03:45:55.000-0600 | Date Closed: | 2018-01-14 08:59:49.000-0600 | ||
Priority: | Trivial | Regression? | |||
Status: | Closed/Complete | Components: | Resources/res_config_pgsql | ||
Versions: | 13.19.0 15.2.0 | Frequency of Occurrence | |||
Related Issues: |
| ||||
Environment: | Attachments: | ( 0) truncation_clang_pgsql.patch | |||
Description: | The compiler _clang_ (5.0.1) reports:{code}res_config_pgsql.c:1299:7: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat]
size < 15 ? size * 2 : ^~~~~~~~~~~~~~~~~~~~~~{code} This issue is caused by the fix for ASTERISK-27156. Previously, the compiler _gcc_ (7.2) reported:{code}res_config_pgsql.c: In function 'require_pgsql': res_config_pgsql.c:1298:51: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 10 [-Wformat-truncation=] snprintf(fieldtype, sizeof(fieldtype), "CHAR(%d)", ^~ res_config_pgsql.c:1298:45: note: directive argument in the range [-2147483648, 255] snprintf(fieldtype, sizeof(fieldtype), "CHAR(%d)", ^~~~~~~~~~{code} | ||||
Comments: | By: Friendly Automation (friendly-automation) 2018-01-14 08:59:51.344-0600 Change 7943 merged by Jenkins2: res_config_pgsql: Avoid typecasting an int to unsigned char. [https://gerrit.asterisk.org/7943|https://gerrit.asterisk.org/7943] By: Friendly Automation (friendly-automation) 2018-01-14 09:04:15.893-0600 Change 7944 merged by Jenkins2: res_config_pgsql: Avoid typecasting an int to unsigned char. [https://gerrit.asterisk.org/7944|https://gerrit.asterisk.org/7944] By: Friendly Automation (friendly-automation) 2018-01-14 09:05:32.350-0600 Change 7942 merged by Jenkins2: res_config_pgsql: Avoid typecasting an int to unsigned char. [https://gerrit.asterisk.org/7942|https://gerrit.asterisk.org/7942] |