The following issues were found

compat/win32/pthread.h
1 issues
InitializeCriticalSection - Exceptions can be thrown in low-memory situations
Security

Line: 24 Column: 43 CWE codes:
Suggestion: Use InitializeCriticalSectionAndSpinCount instead

              static inline int return_0(int i) {
	return 0;
}
#define pthread_mutex_init(a,b) return_0((InitializeCriticalSection((a)), 0))
#define pthread_mutex_destroy(a) DeleteCriticalSection((a))
#define pthread_mutex_lock EnterCriticalSection
#define pthread_mutex_unlock LeaveCriticalSection

typedef int pthread_mutexattr_t;

            

Reported by FlawFinder.

compat/win32/dirent.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 13 Column: 2 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              
struct dirent {
	unsigned char d_type;      /* file type to prevent lstat after readdir */
	char d_name[MAX_PATH * 3]; /* file name (* 3 for UTF-8 conversion) */
};

DIR *opendir(const char *dirname);
struct dirent *readdir(DIR *dir);
int closedir(DIR *dir);

            

Reported by FlawFinder.

ewah/ewah_bitmap.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 141 Column: 4 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              			for (i = 0; i < can_add; ++i)
				self->buffer[self->buffer_size++] = ~buffer[i];
		} else {
			memcpy(self->buffer + self->buffer_size,
				buffer, can_add * sizeof(eword_t));
			self->buffer_size += can_add;
		}

		self->bit_size += can_add * BITS_IN_EWORD;

            

Reported by FlawFinder.

ewah/ewah_io.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 120 Column: 2 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              		return error("corrupt ewah bitmap: eof in data "
			     "(%"PRIuMAX" bytes short)",
			     (uintmax_t)(data_len - len));
	memcpy(self->buffer, ptr, data_len);
	ptr += data_len;
	len -= data_len;

	for (i = 0; i < self->buffer_size; ++i)
		self->buffer[i] = ntohll(self->buffer[i]);

            

Reported by FlawFinder.

compat/win32/dirent.c
1 issues
wchar_t - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 23 Column: 2 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              
DIR *opendir(const char *name)
{
	wchar_t pattern[MAX_PATH + 2]; /* + 2 for '/' '*' */
	WIN32_FIND_DATAW fdata;
	HANDLE h;
	int len;
	DIR *dir;


            

Reported by FlawFinder.

fsck.h
1 issues
printf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 204 Column: 24 CWE codes: 134
Suggestion: Use a constant for the format specification

              void fsck_enable_object_names(struct fsck_options *options);
const char *fsck_get_object_name(struct fsck_options *options,
				 const struct object_id *oid);
__attribute__((format (printf,3,4)))
void fsck_put_object_name(struct fsck_options *options,
			  const struct object_id *oid,
			  const char *fmt, ...);
const char *fsck_describe_object(struct fsck_options *options,
				 const struct object_id *oid);

            

Reported by FlawFinder.

versioncmp.c
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 82 Column: 27 CWE codes: 126

              
	for (i = 0; i < prereleases->nr; i++) {
		const char *suffix = prereleases->items[i].string;
		int start, suffix_len = strlen(suffix);
		if (suffix_len < off)
			start = off - suffix_len;
		else
			start = 0;
		find_better_matching_suffix(s1, suffix, suffix_len, start,

            

Reported by FlawFinder.

gettext.h
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 40 Column: 9 CWE codes: 126

              }
static inline int gettext_width(const char *s)
{
	return strlen(s);
}
#endif

static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
{

            

Reported by FlawFinder.

compat/simple-ipc/ipc-unix-socket.c
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 179 Column: 50 CWE codes: 126

              
	trace2_region_enter("ipc-client", "send-command", NULL);

	if (write_packetized_from_buf_no_flush(message, strlen(message),
					       connection->fd) < 0 ||
	    packet_flush_gently(connection->fd) < 0) {
		ret = error(_("could not send IPC command"));
		goto done;
	}

            

Reported by FlawFinder.

grep.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 157 Column: 2 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              	int extended_regexp_option;
	int pattern_type_option;
	int ignore_locale;
	char colors[NR_GREP_COLORS][COLOR_MAXLEN];
	unsigned pre_context;
	unsigned post_context;
	unsigned last_shown;
	int show_hunk_mark;
	int file_break;

            

Reported by FlawFinder.