Discussion:
[Dnsmasq-discuss] [PATCH 1/1] do not include stdio.h before dnsmasq.h
Christian Hesse
2017-08-22 21:19:29 UTC
Permalink
From: Christian Hesse <***@eworm.de>

We define some constants in dnsmasq.h, which have an influence on
stdio.h. So do not include stdio.h before dnsmasq.h.

Signed-off-by: Christian Hesse <***@eworm.de>
---
src/helper.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/src/helper.c b/src/helper.c
index 635677e..281cb4a 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -14,7 +14,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

-#include <stdio.h>
#include "dnsmasq.h"

#ifdef HAVE_SCRIPT
AW
2017-08-23 07:47:17 UTC
Permalink
That would also fix the sizeof(off_t) mismatch in helper.c and tftp.c bug...
http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2017q3/011691.html



-arne

Christian Hesse <***@eworm.de> schrieb am 21:20 Dienstag, 22.August 2017:


From: Christian Hesse <***@eworm.de>

We define some constants in dnsmasq.h, which have an influence on
stdio.h. So do not include stdio.h before dnsmasq.h.

Signed-off-by: Christian Hesse <***@eworm.de>
---
src/helper.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/src/helper.c b/src/helper.c
index 635677e..281cb4a 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -14,7 +14,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

-#include <stdio.h>
#include "dnsmasq.h"

#ifdef HAVE_SCRIPT
Christian Hesse
2017-08-23 08:23:21 UTC
Permalink
From: Christian Hesse <***@eworm.de>

We define some constants in dnsmasq.h, which have an influence on
stdio.h. So do not include stdio.h before dnsmasq.h.

This fixes a segmentation fault caused by size mismatch for
size_t and off_t on systems where these are 4 bytes without
large file support.
Reported, debugged and tested by Arne Wörner <***@yahoo.com>.

Signed-off-by: Christian Hesse <***@eworm.de>
---
src/helper.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/src/helper.c b/src/helper.c
index 635677e..281cb4a 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -14,7 +14,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

-#include <stdio.h>
#include "dnsmasq.h"

#ifdef HAVE_SCRIPT
Christian Hesse
2017-08-24 06:52:47 UTC
Permalink
From: Christian Hesse <***@eworm.de>

Signed-off-by: Christian Hesse <***@eworm.de>
---
src/dnsmasq.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/src/dnsmasq.h b/src/dnsmasq.h
index 24dda08..987b6eb 100644
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -16,6 +16,12 @@

#define COPYRIGHT "Copyright (c) 2000-2017 Simon Kelley"

+/* We do defines that influence behavior of stdio.h, so complain
+ if included too early. */
+#ifdef _STDIO_H
+# error "Header file stdio.h included too early!"
+#endif
+
#ifndef NO_LARGEFILE
/* Ensure we can use files >2GB (log files may grow this big) */
# define _LARGEFILE_SOURCE 1
Christian Hesse
2017-09-15 11:26:45 UTC
Permalink
Post by Christian Hesse
We define some constants in dnsmasq.h, which have an influence on
stdio.h. So do not include stdio.h before dnsmasq.h.
This fixes a segmentation fault caused by size mismatch for
size_t and off_t on systems where these are 4 bytes without
large file support.
---
src/helper.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/helper.c b/src/helper.c
index 635677e..281cb4a 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -14,7 +14,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
#include "dnsmasq.h"
#ifdef HAVE_SCRIPT
Any news on this one (and the follow up patch)?
--
main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];)
putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);}
Simon Kelley
2017-09-25 16:44:26 UTC
Permalink
Post by Christian Hesse
Any news on this one (and the follow up patch)?
Apologies for the radio-silence. Patches applied.


Cheers,

Simon.

Loading...