summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-20 13:37:47 -0400
committermidipix <writeonce@midipix.org>2016-03-20 13:37:47 -0400
commit3c594dd51a8e699837b32a1c90b1e318d3e0b2fa (patch)
tree9c5117b7d9086dee86199ca05bf9894b86691ea8 /src
parenta51ace90d0bc9650a40fe17e5b857769c4ddebd2 (diff)
downloadslibtool-3c594dd51a8e699837b32a1c90b1e318d3e0b2fa.tar.bz2
slibtool-3c594dd51a8e699837b32a1c90b1e318d3e0b2fa.tar.xz
slbt_exec_link_static_archive(): use PATH_MAX for on-stack buffer size.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_link.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index a9782fb..1ef8b77 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -7,13 +7,13 @@
#include <string.h>
#include <stdbool.h>
#include <fcntl.h>
+#include <limits.h>
#include <errno.h>
#include <sys/stat.h>
#include <slibtool/slibtool.h>
#include "slibtool_spawn_impl.h"
-
/*******************************************************************/
/* */
/* -o <ltlib> switches input result */
@@ -25,6 +25,10 @@
/* */
/*******************************************************************/
+#ifndef PATH_MAX
+#define PATH_MAX _XOPEN_PATH_MAX
+#endif
+
static bool slbt_adjust_input_argument(char * arg, bool fpic)
{
char * dot;
@@ -56,8 +60,8 @@ static int slbt_exec_link_static_archive(
char ** aarg;
char ** parg;
char * ranlib[3];
- char program[2048];
- char output[2048];
+ char program[PATH_MAX];
+ char output [PATH_MAX];
/* placeholders */
slbt_reset_placeholders(ectx);