mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-25 04:43:33 +00:00
. 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
This commit is contained in:
parent
bc28ed90ad
commit
db3bca7b78
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=98375
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= jdk
|
||||
PORTVERSION= ${JDK_VERSION}p${JDK_PATCHSET_VERSION}
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= java devel
|
||||
MASTER_SITES= # http://www.sun.com/software/java2/download.html
|
||||
# http://www.eyesbeyond.com/freebsddom/java/jdk14.html
|
||||
|
16
java/jdk14/files/patch-native::util.c
Normal file
16
java/jdk14/files/patch-native::util.c
Normal file
@ -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 */
|
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= jdk
|
||||
PORTVERSION= ${JDK_VERSION}p${JDK_PATCHSET_VERSION}
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= java devel
|
||||
MASTER_SITES= # http://www.sun.com/software/java2/download.html
|
||||
# http://www.eyesbeyond.com/freebsddom/java/jdk14.html
|
||||
|
16
java/jdk15/files/patch-native::util.c
Normal file
16
java/jdk15/files/patch-native::util.c
Normal file
@ -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 */
|
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= jdk
|
||||
PORTVERSION= ${JDK_VERSION}p${JDK_PATCHSET_VERSION}
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= java devel
|
||||
MASTER_SITES= # http://www.sun.com/software/java2/download.html
|
||||
# http://www.eyesbeyond.com/freebsddom/java/jdk14.html
|
||||
|
16
java/jdk16/files/patch-native::util.c
Normal file
16
java/jdk16/files/patch-native::util.c
Normal file
@ -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 */
|
Loading…
Reference in New Issue
Block a user