From db3bca7b78242764136ebc48f98868a5615162cd Mon Sep 17 00:00:00 2001 From: Greg Lewis Date: Sat, 17 Jan 2004 07:11:12 +0000 Subject: . Check the return value of stat(2) when trying to read the javaws configuration file and behave appropriately if its -1. Fixes a SEGV caused by ignoring the return value and just carrying on. . Bump PORTREVISION. PR: 61392 --- java/jdk16/files/patch-native::util.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 java/jdk16/files/patch-native::util.c (limited to 'java/jdk16/files') diff --git a/java/jdk16/files/patch-native::util.c b/java/jdk16/files/patch-native::util.c new file mode 100644 index 000000000000..719d1ae0e989 --- /dev/null +++ b/java/jdk16/files/patch-native::util.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- ../../deploy/src/javaws/src/share/native/util.c 22 Oct 2003 23:04:17 -0000 1.1.1.1 ++++ ../../deploy/src/javaws/src/share/native/util.c 16 Jan 2004 23:50:11 -0000 +@@ -27,7 +27,10 @@ + + /* Find size of file */ + struct stat statBuf; +- stat(filename, &statBuf); ++ if (stat(filename, &statBuf) == -1) { ++ *buffer = NULL; ++ return 0; ++ } + size = statBuf.st_size; + + /* Allocate memory for contents */ -- cgit v1.2.3