Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon4.gif   Compile issues on Fedora withe current elog source, posted by Allen Tuttle on Tue Sep 11 19:46:40 2018 
    icon2.gif   Re: Compile issues on Fedora withe current elog source, posted by Stefan Ritt on Wed Sep 12 11:10:18 2018 
       icon2.gif   Re: Compile issues on Fedora withe current elog source, posted by Allen Tuttle on Wed Sep 12 15:25:07 2018 
          icon2.gif   Re: Compile issues on Fedora withe current elog source, posted by Allen Tuttle on Wed Sep 12 15:57:31 2018 
       icon2.gif   Re: Compile issues on Fedora withe current elog source, posted by Andreas Luedeke on Wed Sep 12 20:52:22 2018 
          icon2.gif   Re: Compile issues on Fedora withe current elog source, posted by Allen Tuttle on Thu Sep 13 06:12:59 2018 
Message ID: 68843     Entry time: Wed Sep 12 15:57:31 2018     In reply to: 68842
Icon: Reply  Author: Allen Tuttle  Author Email: AllenEmail@wavecable.com 
Category: Bug report  OS: Linux  ELOG Version: 3.1.3 
Subject: Re: Compile issues on Fedora withe current elog source 
A quick test suggests I can't just replace sprintf with snprintf.
Original error:
src/elogd.c:4503:4: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256 [-Wformat-overflow=]
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                          ^~

New error:
src/elogd.c:4503:24: warning: passing argument 2 of ‘snprintf’ makes integer from pointer without a cast [-Wint-conversion]
    snprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                        ^~~~~~~~
In file included from src/elogd.h:42:0,
                 from src/elogd.c:38:
/usr/include/stdio.h:340:12: note: expected ‘size_t {aka long unsigned int}’ but argument is of type ‘char *’
 extern int snprintf (char *__restrict __s, size_t __maxlen,

Allen Tuttle wrote:

I would like to try the new code, I don't see it on elog/download/tar/.
Do you keep updates elsewhere like on get or sourceforge?

Stefan Ritt wrote:

This warning is triggered by the use of the sprintf() funciton, which can write beyond the boundary of the destination string. I replaced it by snprintf(), which should make the compiler happy. Code is committed. Unfortuantely I have no FC27 here, so if there is still some waring with the current code, please post the full warning list here.

Stefan

 

 

ELOG V3.1.5-fe60aaf