The following issues were found
src/third_party/zstandard-1.4.4/zstd/lib/compress/huf_compress.c
1 issues
Line: 719
Column: 13
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
op += hSize;
if (repeat) { *repeat = HUF_repeat_none; }
if (oldHufTable)
memcpy(oldHufTable, table->CTable, sizeof(table->CTable)); /* Save new table */
}
return HUF_compressCTable_internal(ostart, op, oend,
src, srcSize,
nbStreams, table->CTable, bmi2);
}
Reported by FlawFinder.
src/third_party/zlib-1.2.11/crc32.c
1 issues
Line: 143
Column: 15
CWE codes:
362
{
FILE *out;
out = fopen("crc32.h", "w");
if (out == NULL) return;
fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
fprintf(out, "local const z_crc_t FAR ");
fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
Reported by FlawFinder.
src/third_party/zstandard-1.4.4/zstd/contrib/seekable_format/zstd_seekable.h
1 issues
Line: 177
Column: 25
CWE codes:
120
20
typedef int(ZSTD_seekable_seek)(void* opaque, long long offset, int origin);
typedef struct {
void* opaque;
ZSTD_seekable_read* read;
ZSTD_seekable_seek* seek;
} ZSTD_seekable_customFile;
ZSTDLIB_API size_t ZSTD_seekable_initAdvanced(ZSTD_seekable* zs, ZSTD_seekable_customFile src);
#if defined (__cplusplus)
Reported by FlawFinder.
src/third_party/zstandard-1.4.4/zstd/lib/compress/fse_compress.c
1 issues
Line: 509
Column: 9
CWE codes:
120
20
nTotal += abs(normalizedCounter[s]);
if (nTotal != (1U<<tableLog))
RAWLOG(2, "Warning !!! Total == %u != %u !!!", nTotal, 1U<<tableLog);
getchar();
}
#endif
return tableLog;
}
Reported by FlawFinder.
src/third_party/zstandard-1.4.4/zstd/programs/platform.h
1 issues
Line: 27
Column: 13
CWE codes:
134
Suggestion:
Use a constant for the format specification
# define _CRT_SECURE_NO_WARNINGS /* Disable Visual Studio warning messages for fopen, strncpy, strerror */
# if (_MSC_VER <= 1800) /* 1800 == Visual Studio 2013 */
# define _CRT_SECURE_NO_DEPRECATE /* VS2005 - must be declared before <io.h> and <windows.h> */
# define snprintf sprintf_s /* snprintf unsupported by Visual <= 2013 */
# endif
# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
#endif
Reported by FlawFinder.
src/third_party/zstandard-1.4.4/zstd/contrib/linux-kernel/lib/zstd/zstd_internal.h
1 issues
Line: 128
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
* Shared functions to include for inlining
*********************************************/
ZSTD_STATIC void ZSTD_copy8(void *dst, const void *src) {
memcpy(dst, src, 8);
}
/*! ZSTD_wildcopy() :
* custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) */
#define WILDCOPY_OVERLENGTH 8
ZSTD_STATIC void ZSTD_wildcopy(void *dst, const void *src, ptrdiff_t length)
Reported by FlawFinder.
src/third_party/zstandard-1.4.4/zstd/contrib/linux-kernel/lib/zstd/huf_compress.c
1 issues
Line: 740
Column: 4
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
*repeat = HUF_repeat_none;
}
if (oldHufTable) {
memcpy(oldHufTable, CTable, CTableSize);
} /* Save the new table */
}
return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, CTable);
}
Reported by FlawFinder.
src/third_party/zstandard-1.4.4/zstd/contrib/linux-kernel/lib/zstd/fse_decompress.c
1 issues
Line: 132
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
}
}
memcpy(dt, &DTableH, sizeof(DTableH));
}
/* Spread symbols */
{
U32 const tableMask = tableSize - 1;
Reported by FlawFinder.
src/third_party/zstandard-1.4.4/zstd/contrib/linux-kernel/fs/btrfs/zstd.c
1 issues
Line: 411
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
out_buf.size - buf_offset);
kaddr = kmap_atomic(dest_page);
memcpy(kaddr + pg_offset, out_buf.dst + buf_offset, bytes);
kunmap_atomic(kaddr);
pg_offset += bytes;
}
ret = 0;
Reported by FlawFinder.