Mailing List Archive

[Bug 65955] md_store_fs.c:524:72: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
https://bz.apache.org/bugzilla/show_bug.cgi?id=65955

Stefan Eissing <icing@apache.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO

--- Comment #1 from Stefan Eissing <icing@apache.org> ---
The path of the directory to create (if it does not exist), is concatenated
from the parameters (group, name, NULL). With name == NULL, this is the group
directory itself.

In the md store, saving the JSON for a MDomain has the path:

md/staging/www.some.org/md.json

- line 630 makes sure md/staging exists
- line 631 makes sure md/staging/www.some.org exists

and subsequent lines then create the md.json file.

Logging in Apache something like "%s", NULL is allowed and will give the string
"(null)".

With this in mind, does it still look wrong to you? If so, how?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 65955] md_store_fs.c:524:72: warning: ‘%s’ directive argument is null [-Wformat-overflow=] [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=65955

David Binderman <dcb314@hotmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW

--- Comment #2 from David Binderman <dcb314@hotmail.com> ---
Ok, more detail:

The compiler warns about the %s. This is the fourth parameter "name", of
routine mk_group_dir.

This routine is marked static, so we know it is only called in source code
file md_store_fs.c.

$ fgrep -n mk_group_dir ./modules/md/md_store_fs.c
497:static apr_status_t mk_group_dir(const char **pdir, md_store_fs_t *s_fs,
518: md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, rv, p, "mk_group_dir %s perm
set", *pdir);
524: md_log_perror(MD_LOG_MARK, MD_LOG_ERR, rv, p, "mk_group_dir %d %s",
group, name);
630: if ( MD_OK(mk_group_dir(&gdir, s_fs, group, NULL, p))
631: && MD_OK(mk_group_dir(&dir, s_fs, group, name, p))

Line 630 is the smoking gun. QED.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 65955] md_store_fs.c:524:72: warning: ‘%s’ directive argument is null [-Wformat-overflow=] [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=65955

Stefan Eissing <icing@apache.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO

--- Comment #3 from Stefan Eissing <icing@apache.org> ---
Well, there is nothing "smoking" here. The compiler warns since printf
formatting is not defined for NULL, but for Apache logging, it is.

But eliminating compiler warnings is good, so I made the change in r1898962.

Will that work for you?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 65955] md_store_fs.c:524:72: warning: ‘%s’ directive argument is null [-Wformat-overflow=] [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=65955

David Binderman <dcb314@hotmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW

--- Comment #4 from David Binderman <dcb314@hotmail.com> ---
>Will that work for you?

Mostly yes. Thanks.

Minor nit: it is IMHO poor style to nest ternary operators.

I wouldn't bother fixing it again, but you might want to
remember this for the future.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 65955] md_store_fs.c:524:72: warning: ‘%s’ directive argument is null [-Wformat-overflow=] [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=65955

Christophe JAILLET <christophe.jaillet@wanadoo.fr> changed:

What |Removed |Added
----------------------------------------------------------------------------
Keywords| |FixedInTrunk
Status|NEW |RESOLVED
Resolution|--- |FIXED

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org