From 14160c7929485f3d4ef6608e1242f45ebfc753bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Fri, 15 May 1998 20:38:49 +0200
Subject: [PATCH] Added some paranoia.

Rev: src/dynamic_load.c:1.27
---
 src/dynamic_load.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/dynamic_load.c b/src/dynamic_load.c
index 51d1063079..283c0ba831 100644
--- a/src/dynamic_load.c
+++ b/src/dynamic_load.c
@@ -7,7 +7,7 @@
 #  include "stralloc.h"
 #  include "pike_macros.h"
 
-RCSID("$Id: dynamic_load.c,v 1.26 1998/04/17 00:15:01 grubba Exp $");
+RCSID("$Id: dynamic_load.c,v 1.27 1998/05/15 18:38:49 grubba Exp $");
 
 #endif
 
@@ -168,8 +168,12 @@ void f_load_module(INT32 args)
   {
     const char *err = dlerror();
     if(!err) err = "Unknown reason";
-    error("load_module(\"%s\") failed: %s\n",
-	  sp[-args].u.string->str, err);
+    if (sp[-args].u.string->len < 1024) {
+      error("load_module(\"%s\") failed: %s\n",
+	    sp[-args].u.string->str, err);
+    } else {
+      error("load_module() failed: %s\n", err);
+    }
   }
 
   init=(modfun)dlsym(module, "pike_module_init");
@@ -184,8 +188,12 @@ void f_load_module(INT32 args)
   if(!init || !exit)
   {
     dlclose(module);
-    
-    error("Failed to initialize module \"%s\".\n", module_name);
+
+    if (sizeof(module_name) < 1024) {
+      error("Failed to initialize dynamic module \"%s\".\n", module_name);
+    } else {
+      error("Failed to initialize dynamic module.\n");
+    }
   }
 
   new_module=ALLOC_STRUCT(module_list);
-- 
GitLab