From 8c7a451f81e875b27412367b2a0e4958855a709b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Fri, 21 Jul 2000 20:21:36 +0200
Subject: [PATCH] Added paranoia check for NUL in open(). Thanks to
 <zorgon@sdf.freeshell.org>.

Rev: src/modules/files/file.c:1.180
---
 src/modules/files/file.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/modules/files/file.c b/src/modules/files/file.c
index ff5bbe8f96..7a6de8921b 100644
--- a/src/modules/files/file.c
+++ b/src/modules/files/file.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #include "global.h"
-RCSID("$Id: file.c,v 1.179 2000/07/17 22:54:25 hubbe Exp $");
+RCSID("$Id: file.c,v 1.180 2000/07/21 18:21:36 grubba Exp $");
 #include "fdlib.h"
 #include "interpret.h"
 #include "svalue.h"
@@ -1267,6 +1267,10 @@ static void file_open(INT32 args)
   {
      str=Pike_sp[-args].u.string;
 
+     if (strlen(str->str) != str->len) {
+       error("Filenames with NUL are not supported.\n");
+     }
+
 #ifdef PIKE_SECURITY
      if(!CHECK_SECURITY(SECURITY_BIT_SECURITY))
      {
-- 
GitLab