The following issues were found

plugins/linux-capture/xshm-input.c
2 issues
sprintf - Potential format string problem
Security

Line: 368 Column: 4 CWE codes: 134
Suggestion: Make format string constant

              			x11_screen_geo(xcb, i, &w, &h);

		if (name == NULL) {
			sprintf(name_tmp, "%" PRIuFAST32, i);
			name = name_tmp;
		}

		dstr_printf(&screen_info,
			    "Screen %s (%" PRIuFAST32 "x%" PRIuFAST32

            

Reported by FlawFinder.

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

Line: 355 Column: 3 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

              
	for (int_fast32_t i = 0; i < count; ++i) {
		char *name;
		char name_tmp[12];
		int_fast32_t x, y, w, h;
		x = y = w = h = 0;

		name = NULL;
		if (randr)

            

Reported by FlawFinder.

libobs/media-io/video-scaler-ffmpeg.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              		const uint8_t *src = scaler->dst_pointers[plane];
		const size_t height = scaler->dst_heights[plane];
		if (scaled_linesize == plane_linesize) {
			memcpy(dst, src, scaled_linesize * height);
		} else {
			size_t linesize = scaled_linesize;
			if (linesize > plane_linesize)
				linesize = plane_linesize;


            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

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

              				linesize = plane_linesize;

			for (size_t y = 0; y < height; y++) {
				memcpy(dst, src, linesize);
				dst += plane_linesize;
				src += scaled_linesize;
			}
		}
	}

            

Reported by FlawFinder.

deps/obs-scripting/obs-scripting-logging.c
2 issues
vsnprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 50 Column: 2 CWE codes: 134
Suggestion: Use a constant for the format specification

              		start_len = snprintf(msg, sizeof(msg), "[Unknown Script] ");
	}

	vsnprintf(msg + start_len, sizeof(msg) - start_len, format, args);

	if (callback)
		callback(param, script, level, msg + start_len);
	blog(level, "%s", msg);
}

            

Reported by FlawFinder.

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

Line: 27 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

              void script_log_va(obs_script_t *script, int level, const char *format,
		   va_list args)
{
	char msg[2048];
	const char *lang = "(Unknown)";
	size_t start_len;

	if (script) {
		switch (script->type) {

            

Reported by FlawFinder.

deps/jansson/src/strbuffer.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

                      if(!new_value)
            return -1;

        memcpy(new_value, strbuff->value, strbuff->length);

        jsonp_free(strbuff->value);
        strbuff->value = new_value;
        strbuff->size = new_size;
    }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

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

                      strbuff->size = new_size;
    }

    memcpy(strbuff->value + strbuff->length, data, size);
    strbuff->length += size;
    strbuff->value[strbuff->length] = '\0';

    return 0;
}

            

Reported by FlawFinder.

deps/lzma/liblzma/simple/simple_coder.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              		// coder->pos and coder->size yet. This way the coder can be
		// restarted if the next filter in the chain returns e.g.
		// LZMA_MEM_ERROR.
		memcpy(out + *out_pos, coder->buffer + coder->pos, buf_avail);
		*out_pos += buf_avail;

		// Copy/Encode/Decode more data to out[].
		{
			const lzma_ret ret = copy_or_code(coder, allocator,

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

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

              			// There is unfiltered data left in out[]. Copy it to
			// coder->buffer[] and rewind *out_pos appropriately.
			*out_pos -= unfiltered;
			memcpy(coder->buffer, out + *out_pos, unfiltered);
		}
	} else if (coder->pos > 0) {
		memmove(coder->buffer, coder->buffer + coder->pos, buf_avail);
		coder->size -= coder->pos;
		coder->pos = 0;

            

Reported by FlawFinder.

plugins/obs-filters/nvafx-load.h
2 issues
LoadLibrary - Ensure that the full path to the library is specified, or current directory may be used
Security

Line: 145 Column: 15 CWE codes: 829 20
Suggestion: Use LoadLibraryEx with one of the search flags, or call SetSearchPathMode to use a safe search path, or pass a full path to the library

              		return false;

	SetDllDirectoryA(path);
	nv_audiofx = LoadLibrary(L"NVAudioEffects.dll");
	SetDllDirectoryA(NULL);

	return !!nv_audiofx;
}
#endif

            

Reported by FlawFinder.

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

Line: 140 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

              
static bool load_lib(void)
{
	char path[MAX_PATH];
	if (!nvafx_get_sdk_path(path, sizeof(path)))
		return false;

	SetDllDirectoryA(path);
	nv_audiofx = LoadLibrary(L"NVAudioEffects.dll");

            

Reported by FlawFinder.

deps/jansson/test/suites/api/test_dump_callback.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

                  if (len > s->cap - s->off) {
        return -1;
    }
    memcpy(s->buf + s->off, buffer, len);
    s->off += len;
    return 0;
}

static void run_tests()

            

Reported by FlawFinder.

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: 48 Column: 13 CWE codes: 126

                  }

    s.off = 0;
    s.cap = strlen(dumped_to_string);
    s.buf = malloc(s.cap);
    if (!s.buf) {
        json_decref(json);
        free(dumped_to_string);
        fail("malloc failed");

            

Reported by FlawFinder.

plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c
2 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 120 Column: 5 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

              			if (gpu > 0) {
				// if a non-zero GPU failed, almost always
				// user error. tell then to fix it.
				char gpu_str[16];
				snprintf(gpu_str, sizeof(gpu_str) - 1, "%d",
					 (int)gpu);
				gpu_str[sizeof(gpu_str) - 1] = 0;

				dstr_cat(&error_message,

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

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

              			int pos_frame = y * frame_rowsize;
			int pos_pic = y * pic_rowsize;

			memcpy(pic->data[plane] + pos_pic,
			       frame->data[plane] + pos_frame, bytes);
		}
	}
}


            

Reported by FlawFinder.

deps/lzma/liblzma/check/sha256.c
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

              		0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19,
	};

	memcpy(check->state.sha256.state, s, sizeof(s));
	check->state.sha256.size = 0;

	return;
}


            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

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

              		if (copy_size > size)
			copy_size = size;

		memcpy(check->buffer.u8 + copy_start, buf, copy_size);

		buf += copy_size;
		size -= copy_size;
		check->state.sha256.size += copy_size;


            

Reported by FlawFinder.

libobs/obs-windows.c
2 issues
wchar_t - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 73 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

              static void log_processor_info(void)
{
	HKEY key;
	wchar_t data[1024];
	char *str = NULL;
	DWORD size, speed;
	LSTATUS status;

	memset(data, 0, sizeof(data));

            

Reported by FlawFinder.

wchar_t - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 1047 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

              
void obs_key_to_str(obs_key_t key, struct dstr *str)
{
	wchar_t name[128] = L"";
	UINT scan_code;
	int vk;

	if (key == OBS_KEY_NONE) {
		return;

            

Reported by FlawFinder.