Skip to content

Commit

Permalink
s4-heimdal: Fix the format-truncation errors.
Browse files Browse the repository at this point in the history
../source4/heimdal/lib/com_err/compile_et.c: In function ‘generate_h’:
../source4/heimdal/lib/com_err/compile_et.c:138:33: error: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 126 [-Werror=format-truncation=]
     snprintf(fn, sizeof(fn), "__%s__", hfn);
                                 ^~     ~~~
../source4/heimdal/lib/com_err/compile_et.c:138:5: note: ‘snprintf’ output between 5 and 132 bytes into a destination of size 128
     snprintf(fn, sizeof(fn), "__%s__", hfn);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source4/heimdal/lib/com_err/compile_et.c: In function ‘main’:
../source4/heimdal/lib/com_err/compile_et.c:234:35: error: ‘.h’ directive output may be truncated writing 2 bytes into a region of size between 1 and 128 [-Werror=format-truncation=]
     snprintf(hfn, sizeof(hfn), "%s.h", Basename);
                                   ^~
../source4/heimdal/lib/com_err/compile_et.c:234:5: note: ‘snprintf’ output between 3 and 130 bytes into a destination of size 128
     snprintf(hfn, sizeof(hfn), "%s.h", Basename);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source4/heimdal/lib/com_err/compile_et.c:235:35: error: ‘.c’ directive output may be truncated writing 2 bytes into a region of size between 1 and 128 [-Werror=format-truncation=]
     snprintf(cfn, sizeof(cfn), "%s.c", Basename);
                                   ^~
../source4/heimdal/lib/com_err/compile_et.c:235:5: note: ‘snprintf’ output between 3 and 130 bytes into a destination of size 128
     snprintf(cfn, sizeof(cfn), "%s.c", Basename);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437

Guenther

Signed-off-by: Günther Deschner <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>

Autobuild-User(master): Andreas Schneider <[email protected]>
Autobuild-Date(master): Fri Jun  8 13:23:51 CEST 2018 on sn-devel-144
  • Loading branch information
gd authored and cryptomilk committed Jun 8, 2018
1 parent ae4e545 commit 7ddbf60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source4/heimdal/lib/com_err/compile_et.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ extern int yydebug = 1;
#endif

char *filename;
char hfn[128];
char cfn[128];
char hfn[130];
char cfn[130];

struct error_code *codes = NULL;

Expand Down Expand Up @@ -128,7 +128,7 @@ static int
generate_h(void)
{
struct error_code *ec;
char fn[128];
char fn[134];
FILE *h_file = fopen(hfn, "w");
char *p;

Expand Down

0 comments on commit 7ddbf60

Please sign in to comment.