icecat: add release icecat-140.10.1-1gnu1 for ecne

This commit is contained in:
Ark74 2026-05-04 16:58:41 -06:00
parent a5f93cb214
commit ff85d7c623
1256 changed files with 63469 additions and 24141 deletions

View file

@ -43,6 +43,15 @@ NS_INTERFACE_MAP_BEGIN(SlicedInputStream)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream)
NS_INTERFACE_MAP_END
// It is highly unlikely for a stream to exceed INT64_MAX bytes in length, so we
// clamp these values here to allow callers as well as SlicedInputStream to
// avoid unnecessary integer overflow checks. Out of range start/length values
// should behave as expected in all realistic situations.
//
// Some stream APIs use an int64_t (e.g. Tell), so we use INT64_MAX as the
// maximum internal offset for start/end.
static constexpr uint64_t kMaxStreamPos = INT64_MAX;
SlicedInputStream::SlicedInputStream(
already_AddRefed<nsIInputStream> aInputStream, uint64_t aStart,
uint64_t aLength)
@ -53,8 +62,8 @@ SlicedInputStream::SlicedInputStream(
mWeakAsyncInputStream(nullptr),
mWeakInputStreamLength(nullptr),
mWeakAsyncInputStreamLength(nullptr),
mStart(aStart),
mLength(aLength),
mStart(std::clamp<uint64_t>(aStart, 0, kMaxStreamPos)),
mLength(std::clamp<uint64_t>(aLength, 0, kMaxStreamPos - mStart)),
mCurPos(0),
mClosed(false),
mAsyncWaitFlags(0),
@ -491,11 +500,11 @@ bool SlicedInputStream::Deserialize(
const SlicedInputStreamParams& params = aParams.get_SlicedInputStreamParams();
auto end = CheckedUint64(params.start()) + params.length();
if (!end.isValid()) {
if (params.start() > kMaxStreamPos ||
params.length() > kMaxStreamPos - params.start()) {
return false;
}
if (params.curPos() > end.value()) {
if (params.curPos() > params.start() + params.length()) {
return false;
}

View file

@ -47,7 +47,11 @@ class SlicedInputStream final : public nsIAsyncInputStream,
// than aStart bytes, reading from SlicedInputStream returns no data. If
// aInputStream contains more than aStart bytes, but fewer than aStart +
// aLength bytes, reading from SlicedInputStream returns as many bytes as can
// be consumed from aInputStream after reading aLength bytes.
// be consumed from aInputStream after reading aStart bytes.
//
// It is safe to specify an arbitrarily large aLength (e.g. UINT64_MAX). Doing
// so is treated as allowing an arbitrary number of additional bytes following
// aStart.
//
// aInputStream should not be read from after constructing a
// SlicedInputStream wrapper around it.

View file

@ -27,5 +27,12 @@ interface nsICloneableInputStream : nsISupports
[scriptable, builtinclass, uuid(ece853c3-aded-4cef-8f51-0d1493d60bd5)]
interface nsICloneableInputStreamWithRange : nsICloneableInputStream
{
// Create a copy of the input stream, but with the data range reduced to a
// sub-slice. The copy will begin at `start` bytes, and extends for a maximum
// of `length` bytes. If the underlying stream contains more than `start`
// bytes, but fewer than `length` bytes, reading from the stream returns all
// remaining bytes.
//
// See SlicedInputStream's constructor for more details.
nsIInputStream cloneWithRange(in uint64_t start, in uint64_t length);
};

View file

@ -53,6 +53,7 @@ const char* const sExecutableExts[] = {
".chm",
".cmd",
".com",
".command", // Mac script
".cpl",
".crt",
".der",
@ -115,6 +116,7 @@ const char* const sExecutableExts[] = {
".scf", // Windows explorer command
".scr",
".sct",
".search-ms", // Windows Saved Search
".settingcontent-ms",
".shb",
".shs",

View file

@ -8,9 +8,9 @@
#define _NS_LOCAL_FILE_COMMON_H_
#ifdef MOZ_ESR
extern const char* const sExecutableExts[110];
extern const char* const sExecutableExts[112];
#else
extern const char* const sExecutableExts[111];
extern const char* const sExecutableExts[113];
#endif
#endif

View file

@ -1958,21 +1958,22 @@ nsLocalFile::IsExecutable(bool* aResult) {
// Search for any of the set of executable extensions.
static const char* const executableExts[] = {
#ifdef MOZ_WIDGET_COCOA
"afploc", // Can point to other files.
".afploc", // Can point to other files.
#endif
"air", // Adobe AIR installer
".air", // Adobe AIR installer
#ifdef MOZ_WIDGET_COCOA
"atloc", // Can point to other files.
"fileloc", // File location files can be used to point to other
// files.
"ftploc", // Can point to other files.
"inetloc", // Shouldn't be able to do the same, but can, due to
// macOS vulnerabilities.
"terminal", // macOS Terminal app configuration files
".atloc", // Can point to other files.
".command", // Mac script
".fileloc", // File location files can be used to point to other
// files.
".ftploc", // Can point to other files.
".inetloc", // Shouldn't be able to do the same, but can, due to
// macOS vulnerabilities.
".terminal", // macOS Terminal app configuration files
#endif
"jar" // java application bundle
".jar" // java application bundle
};
nsDependentSubstring ext = Substring(path, dotIdx + 1);
nsDependentSubstring ext = Substring(path, dotIdx);
for (auto executableExt : executableExts) {
if (ext.EqualsASCII(executableExt)) {
// Found a match. Set result and quit.