Skip to content

Commit

Permalink
solved stringop-truncation warnings in domain.c and lang.c
Browse files Browse the repository at this point in the history
  • Loading branch information
sagredo-dev committed Jan 18, 2024
1 parent 602ff5e commit 0230c58
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
9 changes: 5 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
2.4.0beta
21/12/2023 Roberto Puzzanghera https://notes.sagredo.eu
unreleased
Roberto Puzzanghera https://notes.sagredo.eu

* solved stringop-truncation warnings in domain.c and lang.c
and removed -Wno-stringop-truncation on CFLAGS in configure.ac
* fixed buffer overflows in domain.c
* edited lang.c to lowercase the language file to solve compatibility issues with google-chrome
and to avoid errors due to "invalid language file" in some browsers.
* restored the autotools files to allow compilation on 64b platforms.
Expand All @@ -25,8 +28,6 @@
* language files moved to lang/ dir. Modifiend lang.c accordingly
* undefined several variables generated by configure in all .c files, as they conflicted with homonymous
vpopmail's variables imported from its config.h, in order to avoid warnings during the compilation.
* added -Wno-stringop-truncation on CFLAGS in configure.ac to selectively remove the warning message (the
original code seems to know what is doing)
* fixed compilation warnings in acl.c
* fixed compilation warnings -Wformat-overflow and -Wformat-truncation in domain.c
* corrected the README file for obsolete informations and renemed to README.md
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5700,8 +5700,8 @@ printf "%s\n" "#define VQA_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h


if test "$GCC" = yes ; then
CXXFLAGS="$CXXFLAGS -Wall -Wno-stringop-truncation"
CFLAGS="$CFLAGS -Wall -Wno-stringop-truncation"
CXXFLAGS="$CXXFLAGS -Wall"
CFLAGS="$CFLAGS -Wall"
fi

qmaildir=""
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ AC_DEFINE_UNQUOTED(VQA_PACKAGE,"$PACKAGE_NAME",Package name)
AC_DEFINE_UNQUOTED(VQA_VERSION,"$PACKAGE_VERSION",Package version)

if test "$GCC" = yes ; then
CXXFLAGS="$CXXFLAGS -Wall -Wno-stringop-truncation"
CFLAGS="$CFLAGS -Wall -Wno-stringop-truncation"
CXXFLAGS="$CXXFLAGS -Wall"
CFLAGS="$CFLAGS -Wall"
fi

qmaildir=""
Expand Down
9 changes: 5 additions & 4 deletions domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,11 @@ void list_domains()
char *tmpbuf;
char *assign_domain;
char *assign_alias_domain;
char bgcolor[30];
char fgcolor[30];
char face[30];
char size[30];
#define MAX_TMPBUF 200
char bgcolor[MAX_TMPBUF];
char fgcolor[MAX_TMPBUF];
char face[MAX_TMPBUF];
char size[MAX_TMPBUF];

tmpbuf = malloc(500);
if (!(acl_features & ACL_DOMAIN_VIEW)) {
Expand Down
2 changes: 1 addition & 1 deletion lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void set_language()
tmpstr = getenv("HTTP_ACCEPT_LANGUAGE");

if ( tmpstr != NULL ) {
strncpy(tmpbuf, tmpstr, MAX_TMPBUF);
strncpy(tmpbuf, tmpstr, 50);
tmpstr = strtok(tmpbuf, " ,\n");

for(lang_err = -1;tmpstr!=NULL && lang_err!=0;) {
Expand Down

0 comments on commit 0230c58

Please sign in to comment.