[asterisk-commits] russell: branch group/res_config_ldap r72628 - in /team/group/res_config_ldap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 29 10:22:32 CDT 2007


Author: russell
Date: Fri Jun 29 10:22:32 2007
New Revision: 72628

URL: http://svn.digium.com/view/asterisk?view=rev&rev=72628
Log:
Merged revisions 72539,72555,72557,72598,72600 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r72539 | qwell | 2007-06-28 16:31:00 -0500 (Thu, 28 Jun 2007) | 5 lines

Apparently some builds of gcc don't have declaration-after-statement.
This checks for it in configure, and only uses it if it's available.

If it's wrong, somebody please yell at me and tell me why.

................
r72555 | tilghman | 2007-06-28 23:45:13 -0500 (Thu, 28 Jun 2007) | 9 lines

Blocked revisions 72554 via svnmerge

........
r72554 | tilghman | 2007-06-28 23:43:15 -0500 (Thu, 28 Jun 2007) | 2 lines

Fix 1.4 breakage

........

................
r72557 | tilghman | 2007-06-28 23:56:08 -0500 (Thu, 28 Jun 2007) | 10 lines

Merged revisions 72556 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r72556 | tilghman | 2007-06-28 23:47:11 -0500 (Thu, 28 Jun 2007) | 2 lines

Issue 10055 - Change memory allocation to use the heap for a command, since the output has the potential to overflow the stack (as it did here)

........

................
r72598 | file | 2007-06-29 09:20:15 -0500 (Fri, 29 Jun 2007) | 9 lines

Blocked revisions 72597 via svnmerge

........
r72597 | file | 2007-06-29 11:18:36 -0300 (Fri, 29 Jun 2007) | 2 lines

Backport fix for GCC versions without support for declaration-after-statement.

........

................
r72600 | file | 2007-06-29 09:27:24 -0500 (Fri, 29 Jun 2007) | 9 lines

Blocked revisions 72599 via svnmerge

........
r72599 | file | 2007-06-29 11:26:32 -0300 (Fri, 29 Jun 2007) | 2 lines

Minor change for older GCC versions.

........

................

Modified:
    team/group/res_config_ldap/   (props changed)
    team/group/res_config_ldap/Makefile
    team/group/res_config_ldap/configure
    team/group/res_config_ldap/configure.ac
    team/group/res_config_ldap/main/manager.c
    team/group/res_config_ldap/makeopts.in

Propchange: team/group/res_config_ldap/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/group/res_config_ldap/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/group/res_config_ldap/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 29 10:22:32 2007
@@ -1,1 +1,1 @@
-/trunk:1-72526
+/trunk:1-72627

Modified: team/group/res_config_ldap/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/Makefile?view=diff&rev=72628&r1=72627&r2=72628
==============================================================================
--- team/group/res_config_ldap/Makefile (original)
+++ team/group/res_config_ldap/Makefile Fri Jun 29 10:22:32 2007
@@ -193,7 +193,7 @@
 ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
 
 ifeq ($(AST_DEVMODE),yes)
-  ASTCFLAGS+=-Werror -Wunused -Wundef -Wdeclaration-after-statement
+  ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT)
 endif
 
 ifneq ($(findstring BSD,$(OSARCH)),)

Modified: team/group/res_config_ldap/configure
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/configure?view=diff&rev=72628&r1=72627&r2=72628
==============================================================================
--- team/group/res_config_ldap/configure (original)
+++ team/group/res_config_ldap/configure Fri Jun 29 10:22:32 2007
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 69704 .
+# From configure.ac Revision: 71746 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -906,6 +906,7 @@
 POW_LIB
 GC_CFLAGS
 GC_LDFLAGS
+AST_DECLARATION_AFTER_STATEMENT
 GSM_INTERNAL
 KDEINIT
 KDEDIR
@@ -15702,6 +15703,20 @@
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 CFLAGS="${saved_CFLAGS}"
+
+
+
+{ echo "$as_me:$LINENO: checking for -Wdeclaration-after-statement support" >&5
+echo $ECHO_N "checking for -Wdeclaration-after-statement support... $ECHO_C" >&6; }
+if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+	{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
+else
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+	AST_DECLARATION_AFTER_STATEMENT=
+fi
 
 
 
@@ -37259,10 +37274,10 @@
 POW_LIB!$POW_LIB$ac_delim
 GC_CFLAGS!$GC_CFLAGS$ac_delim
 GC_LDFLAGS!$GC_LDFLAGS$ac_delim
+AST_DECLARATION_AFTER_STATEMENT!$AST_DECLARATION_AFTER_STATEMENT$ac_delim
 GSM_INTERNAL!$GSM_INTERNAL$ac_delim
 KDEINIT!$KDEINIT$ac_delim
 KDEDIR!$KDEDIR$ac_delim
-NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -37304,6 +37319,7 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim
 PG_CONFIG!$PG_CONFIG$ac_delim
 PTLIB_CONFIG!$PTLIB_CONFIG$ac_delim
 PWLIBDIR!$PWLIBDIR$ac_delim
@@ -37331,7 +37347,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 25; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 26; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: team/group/res_config_ldap/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/configure.ac?view=diff&rev=72628&r1=72627&r2=72628
==============================================================================
--- team/group/res_config_ldap/configure.ac (original)
+++ team/group/res_config_ldap/configure.ac Fri Jun 29 10:22:32 2007
@@ -326,6 +326,17 @@
 CFLAGS="${saved_CFLAGS}"
 AC_SUBST(GC_CFLAGS)
 AC_SUBST(GC_LDFLAGS)
+
+AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
+if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+	AC_MSG_RESULT(yes)
+	AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
+else
+	AC_MSG_RESULT(no)
+	AST_DECLARATION_AFTER_STATEMENT=
+fi
+AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
+
 
 AC_MSG_CHECKING(for sysinfo)
 AC_LINK_IFELSE(

Modified: team/group/res_config_ldap/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/main/manager.c?view=diff&rev=72628&r1=72627&r2=72628
==============================================================================
--- team/group/res_config_ldap/main/manager.c (original)
+++ team/group/res_config_ldap/main/manager.c Fri Jun 29 10:22:32 2007
@@ -1847,17 +1847,26 @@
 	/* FIXME: Wedge a ActionID response in here, waiting for later changes */
 	ast_cli_command(fd, cmd);	/* XXX need to change this to use a FILE * */
 	l = lseek(fd, 0, SEEK_END);	/* how many chars available */
-	buf = alloca(l + 1);
-	final_buf = alloca(l + 1);
-	lseek(fd, 0, SEEK_SET);
-	read(fd, buf, l);
-	buf[l] = '\0';
+
+	/* This has a potential to overflow the stack.  Hence, use the heap. */
+	buf = ast_calloc(1, l + 1);
+	final_buf = ast_calloc(1, l + 1);
+	if (buf) {
+		lseek(fd, 0, SEEK_SET);
+		read(fd, buf, l);
+		buf[l] = '\0';
+		if (final_buf) {
+			term_strip(final_buf, buf, l);
+			final_buf[l] = '\0';
+		}
+		astman_append(s, S_OR(final_buf, buf));
+		ast_free(buf);
+	}
 	close(fd);
 	unlink(template);
-	term_strip(final_buf, buf, l);
-	final_buf[l] = '\0';
-	astman_append(s, final_buf);
 	astman_append(s, "--END COMMAND--\r\n\r\n");
+	if (final_buf)
+		ast_free(final_buf);
 	return 0;
 }
 

Modified: team/group/res_config_ldap/makeopts.in
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/makeopts.in?view=diff&rev=72628&r1=72627&r2=72628
==============================================================================
--- team/group/res_config_ldap/makeopts.in (original)
+++ team/group/res_config_ldap/makeopts.in Fri Jun 29 10:22:32 2007
@@ -62,6 +62,8 @@
 
 AST_DEVMODE=@AST_DEVMODE@
 
+AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
+
 ASOUND_INCLUDE=@ALSA_INCLUDE@
 ASOUND_LIB=@ALSA_LIB@
 




More information about the asterisk-commits mailing list