Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Avoids:
WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson.
See also: https://github.com/mesonbuild/meson/issues/9300
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Given that libudev is widely available on many Linux distros, we
can use the relevant APIs to iterate over all the devices associated
with the drm subsystem to figure out if a specific vendor GPU
is available or not.
This capability (identifying GPU Vendor) is useful to determine
whether to launch Gstreamer pipeline using h/w accelerated
plugins. On systems where libudev is not available (Windows,
MacOS, etc) we'd have to make this determination based on the
availability of the relevant plugins in the Gstreamer registry.
Cc: Frediano Ziglio <freddy77@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>
Cc: Hazwan Arif Mazlan <hazwan.arif.mazlan@intel.com>
Cc: Jin Chung Teng <jin.chung.teng@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
|
|
EVP_PKEY_cmp was made obsolete in OpenSSL.
The main reason is that the return value is not coherent with
other *_cmp functions.
So it was replaced by EVP_PKEY_eq, which does the same.
Rename to avoid a deprecation warning on newer OpenSSL releases.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Without it on Fedora 35 Wine is not able to find DLLs installed
on the system.
This will cause failures executing tests but this also helps in
case there are tests during the configuration phase.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Currently using Meson the command "python -m <MODULE_NAME>" is
run. However this command instead of trying to import the module
tried to execute it as a script failing for the updated pyparsing
with:
/usr/bin/python3: No module named pyparsing.__main__; 'pyparsing' is a package and cannot be directly executed
So instead use "python -c 'import <MODULE_NAME>".
Autoconf is already using that command (see m4/ax_python_module.m4).
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
This fixes partially https://gitlab.freedesktop.org/spice/spice-gtk/-/issues/144.
Meson requires Python3 so you should be able to detect python3.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
This avoids this warning:
WARNING: Project targeting '>= 0.48.0' but tried to use feature introduced in '0.49.0': / with string arguments.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Add const specifier to passed structure.
Make code a bit more "safe" as compiler can check if code is
trying to change some passed data.
Also allows to declare data passed as constant.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
Tell build system how to generate the intermediate file
generated_test_messages.h.
Otherwise if removed the build will then fail.
This is also probably the reason some build intermittently fail.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Win32 requires winsock2.h to be included in order to use ntohl.
To avoid the include use GUINT32_FROM_BE instead, already available.
This problem was reported by Biswapriyo Nath whom also tested the
solution for Win32.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
We need to package generated_test_messages.h file
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
The caller use the "size" argument in different ways. Either the size of
the data to convert, or the end boundary to be deduced by offset.
Fix it so the the "size" argument means the amount in bytes of data to
convert, that seems simpler and saner. (yay C)
Fixes: spice#53
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
It is required for strcmp. This fixes a compiler warning for mingw-w64.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
Make sure the output array is zero terminated to simplify
code using the output structures.
Changed in generated code:
diff -ru gen/generated_client_demarshallers.c common/generated_client_demarshallers.c
--- gen/generated_client_demarshallers.c 2021-02-21 15:13:42.004307087 +0000
+++ common/generated_client_demarshallers.c 2021-02-21 15:13:58.916513426 +0000
@@ -565,15 +565,24 @@
return NULL;
}
-static uint8_t * parse_array_uint8(uint8_t *message_start, SPICE_GNUC_UNUSED uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info)
+static uint8_t * parse_array_uint8_terminated(uint8_t *message_start, SPICE_GNUC_UNUSED uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info)
{
uint8_t *in = message_start + this_ptr_info->offset;
uint8_t *end;
end = struct_data;
memcpy(end, in, this_ptr_info->nelements);
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+ ((char *) (end))[this_ptr_info->nelements] = 0;
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
in += this_ptr_info->nelements;
end += this_ptr_info->nelements;
+ end += 1;
return end;
}
@@ -622,7 +631,8 @@
dst_info_host_data__array__nelements = host_size__value;
dst_info_host_data__array__nw_size = dst_info_host_data__array__nelements;
- dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements;
+ dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements + sizeof(uint8_t);
+ dst_info_host_data__array__mem_size = SPICE_ALIGN(dst_info_host_data__array__mem_size, 4);
if (SPICE_UNLIKELY(dst_info_host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) {
goto error;
}
@@ -650,7 +660,8 @@
dst_info_cert_subject_data__array__nelements = cert_subject_size__value;
dst_info_cert_subject_data__array__nw_size = dst_info_cert_subject_data__array__nelements;
- dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements;
+ dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements + sizeof(uint8_t);
+ dst_info_cert_subject_data__array__mem_size = SPICE_ALIGN(dst_info_cert_subject_data__array__mem_size, 4);
if (SPICE_UNLIKELY(dst_info_cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) {
goto error;
}
@@ -685,14 +696,14 @@
out->dst_info.sport = consume_uint16(&in);
out->dst_info.host_size = consume_uint32(&in);
ptr_info[n_ptr].offset = consume_uint32(&in);
- ptr_info[n_ptr].parse = parse_array_uint8;
+ ptr_info[n_ptr].parse = parse_array_uint8_terminated;
ptr_info[n_ptr].dest = (void **)&out->dst_info.host_data;
host_data__array__nelements = out->dst_info.host_size;
ptr_info[n_ptr].nelements = host_data__array__nelements;
n_ptr++;
out->dst_info.cert_subject_size = consume_uint32(&in);
ptr_info[n_ptr].offset = consume_uint32(&in);
- ptr_info[n_ptr].parse = parse_array_uint8;
+ ptr_info[n_ptr].parse = parse_array_uint8_terminated;
ptr_info[n_ptr].dest = (void **)&out->dst_info.cert_subject_data;
cert_subject_data__array__nelements = out->dst_info.cert_subject_size;
ptr_info[n_ptr].nelements = cert_subject_data__array__nelements;
@@ -1050,7 +1061,8 @@
host_data__array__nelements = host_size__value;
host_data__array__nw_size = host_data__array__nelements;
- host_data__array__mem_size = sizeof(uint8_t) * host_data__array__nelements;
+ host_data__array__mem_size = sizeof(uint8_t) * host_data__array__nelements + sizeof(uint8_t);
+ host_data__array__mem_size = SPICE_ALIGN(host_data__array__mem_size, 4);
if (SPICE_UNLIKELY(host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) {
goto error;
}
@@ -1078,7 +1090,8 @@
cert_subject_data__array__nelements = cert_subject_size__value;
cert_subject_data__array__nw_size = cert_subject_data__array__nelements;
- cert_subject_data__array__mem_size = sizeof(uint8_t) * cert_subject_data__array__nelements;
+ cert_subject_data__array__mem_size = sizeof(uint8_t) * cert_subject_data__array__nelements + sizeof(uint8_t);
+ cert_subject_data__array__mem_size = SPICE_ALIGN(cert_subject_data__array__mem_size, 4);
if (SPICE_UNLIKELY(cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) {
goto error;
}
@@ -1107,13 +1120,13 @@
out->sport = consume_uint16(&in);
out->host_size = consume_uint32(&in);
ptr_info[n_ptr].offset = consume_uint32(&in);
- ptr_info[n_ptr].parse = parse_array_uint8;
+ ptr_info[n_ptr].parse = parse_array_uint8_terminated;
ptr_info[n_ptr].dest = (void **)&out->host_data;
ptr_info[n_ptr].nelements = host_data__array__nelements;
n_ptr++;
out->cert_subject_size = consume_uint32(&in);
ptr_info[n_ptr].offset = consume_uint32(&in);
- ptr_info[n_ptr].parse = parse_array_uint8;
+ ptr_info[n_ptr].parse = parse_array_uint8_terminated;
ptr_info[n_ptr].dest = (void **)&out->cert_subject_data;
ptr_info[n_ptr].nelements = cert_subject_data__array__nelements;
n_ptr++;
@@ -1338,7 +1351,8 @@
dst_info_host_data__array__nelements = host_size__value;
dst_info_host_data__array__nw_size = dst_info_host_data__array__nelements;
- dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements;
+ dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements + sizeof(uint8_t);
+ dst_info_host_data__array__mem_size = SPICE_ALIGN(dst_info_host_data__array__mem_size, 4);
if (SPICE_UNLIKELY(dst_info_host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) {
goto error;
}
@@ -1366,7 +1380,8 @@
dst_info_cert_subject_data__array__nelements = cert_subject_size__value;
dst_info_cert_subject_data__array__nw_size = dst_info_cert_subject_data__array__nelements;
- dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements;
+ dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements + sizeof(uint8_t);
+ dst_info_cert_subject_data__array__mem_size = SPICE_ALIGN(dst_info_cert_subject_data__array__mem_size, 4);
if (SPICE_UNLIKELY(dst_info_cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) {
goto error;
}
@@ -1401,14 +1416,14 @@
out->dst_info.sport = consume_uint16(&in);
out->dst_info.host_size = consume_uint32(&in);
ptr_info[n_ptr].offset = consume_uint32(&in);
- ptr_info[n_ptr].parse = parse_array_uint8;
+ ptr_info[n_ptr].parse = parse_array_uint8_terminated;
ptr_info[n_ptr].dest = (void **)&out->dst_info.host_data;
host_data__array__nelements = out->dst_info.host_size;
ptr_info[n_ptr].nelements = host_data__array__nelements;
n_ptr++;
out->dst_info.cert_subject_size = consume_uint32(&in);
ptr_info[n_ptr].offset = consume_uint32(&in);
- ptr_info[n_ptr].parse = parse_array_uint8;
+ ptr_info[n_ptr].parse = parse_array_uint8_terminated;
ptr_info[n_ptr].dest = (void **)&out->dst_info.cert_subject_data;
cert_subject_data__array__nelements = out->dst_info.cert_subject_size;
ptr_info[n_ptr].nelements = cert_subject_data__array__nelements;
@@ -7582,7 +7597,8 @@
name__array__nelements = name_size__value;
name__array__nw_size = name__array__nelements;
- name__array__mem_size = sizeof(uint8_t) * name__array__nelements;
+ name__array__mem_size = sizeof(uint8_t) * name__array__nelements + sizeof(uint8_t);
+ name__array__mem_size = SPICE_ALIGN(name__array__mem_size, 4);
if (SPICE_UNLIKELY(name__array__nw_size > (uintptr_t) (message_end - message_start - name__value))) {
goto error;
}
@@ -7609,7 +7625,7 @@
out->name_size = consume_uint32(&in);
ptr_info[n_ptr].offset = consume_uint32(&in);
- ptr_info[n_ptr].parse = parse_array_uint8;
+ ptr_info[n_ptr].parse = parse_array_uint8_terminated;
ptr_info[n_ptr].dest = (void **)&out->name;
ptr_info[n_ptr].nelements = name__array__nelements;
n_ptr++;
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
Currently the attribute is not used.
However we would like to make sure when present that the array
is always zero terminated to simplify usages after demarshalling.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
Current propagated attributes are propagated only from member to
member type.
But for pointers you probably want to use propagated attribus to
underlying type (like an array for instance).
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
If the size is not constant the array has to be allocated in some
way in the output and so there must be a specification for the
output (as default is write into the C structure all data).
The only exceptions are when the length is constant (in this case
a constant length array in the C structure is used) or a pointer
(in this case the pointer allocate the array).
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
Allows to reuse it.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
|
|
This syntax was only used in protocol 1 which has been removed
time ago.
Beside not being used it's confusing and prone to errors,
array size is specified using 2 identifiers, one reporting
bytes and the other number of items, one used for marshalling,
the other for demarshalling.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
To use for start for the fuzzer.
Tests have been generated with a patch like:
diff --git a/tests/test-quic.c b/tests/test-quic.c
--- a/tests/test-quic.c
+++ b/tests/test-quic.c
@@ -372,8 +372,8 @@ static void pixbuf_compare(GdkPixbuf *pixbuf_a, GdkPixbuf *pixbuf_b)
static GdkPixbuf *pixbuf_new_random(int alpha)
{
gboolean has_alpha = alpha >= 0 ? alpha : g_random_boolean();
- gint width = g_random_int_range(100, 2000);
- gint height = g_random_int_range(100, 500);
+ gint width = g_random_int_range(10, 100);
+ gint height = g_random_int_range(10, 100);
GdkPixbuf *random_pixbuf;
guint i, size;
guint8 *pixels;
@@ -401,6 +401,12 @@ static void test_pixbuf(GdkPixbuf *pixbuf)
compressed_data = quic_encode_from_pixbuf(pixbuf, imgbuf);
uncompressed_pixbuf = quic_decode_to_pixbuf(compressed_data);
+ {
+ static int num = 0;
+ char fn[256];
+ sprintf(fn, "test%d.quic", ++num);
+ g_assert(g_file_set_contents(fn, (void *) compressed_data->data, compressed_data->len, NULL));
+ }
image_buf_free(imgbuf, uncompressed_pixbuf);
//g_assert(memcmp(gdk_pixbuf_get_pixels(pixbuf), gdk_pixbuf_get_pixels(uncompressed_pixbuf), gdk_pixbuf_get_byte_length(uncompressed_pixbuf)));
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Allows it to be used for fuzzying compressed images.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Proved by fuzzing the code.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Avoid buffer overflows decoding images. On compression we compute
lengths till end of line so it won't cause regressions.
Proved by fuzzing the code.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Avoid some overflow in code due to images too big or
negative numbers.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
All paths already pass some data to quic_decode_begin but for the
test check it, it's not that expensive test.
Checking for not 0 is enough, all other words will potentially be
read calling more_io_words but we need one to avoid a potential
initial buffer overflow or deferencing an invalid pointer.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Add support for VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE flag.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com>
|
|
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|
|
This is the couterpart of spice-protocol commit
commit cbe7b2c28543f4c5e57d1db1b753b73a64104162 (HEAD -> master, origin/master, origin/HEAD)
Author: SimonP <simonp.git@gmail.com>
protocol: Add support for side mouse buttons
Side mouse buttons currently do not exist in the protocol, causing them
to be inexplicably ignored by VMs in virt-manager and such. This lays
the groundwork for fixing that issue.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
|
|
There's no point on checking an empty IP address, an IP
address is never empty.
This also solve some compiler warnings trying to possibly
pass a NULL pointer to memcmp or setting a variable without
reading it.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
The "##" before __VA_ARGS__ is a GCC extension.
Try to limit its usage where necessary.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
In backtrace.h spice_backtrace is defined as:
#if defined(WIN32) && !defined(__MINGW32__)
#define spice_backtrace()
#else
..
so don't try to compile if an empty macro is used.
Currently not causing any issue as we use MingW on Windows but
does not hurt is code is more portable.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
Signed-off-by: Haochen Tong <i@hexchain.org>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Signed-off-by: Haochen Tong <i@hexchain.org>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
|
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
|
|
Instead of just plain preprocessor macros use an enum.
This is more type safe and could produce better debugging
type information.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Ropé <jrope@gmail.com>
|
|
mode should be an enumeration value of SpiceAudioDataMode.
Return type is just a boolean.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Ropé <jrope@gmail.com>
|
|
In Meson better to use --werror option instead to manually add to
options.
Also this prevents build if spice-protocol deprecate some stuff
or fails the build if any warning occur.
This fixes an issue for
https://gitlab.freedesktop.org/spice/spice/-/issues/44.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
|
|
Some Windows headers define "small" causing issues.
Use "small_rect" instead. For coherence use "big_rect" instead of
"big".
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
|
|
Reuse SPICE_GNUC_NORETURN and SPICE_GNUC_PRINTF
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
|
|
The "more_space" callback is used in both decode and encode path to provide
either more space to read or more space to write.
The current implementation was dealing only to provide more space to write
(that is encoding) crashing in case it was used for decoding.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
|
|
QUIC uses different methods to reduce image size.
One uses RLE on pixels. Using fixed images allows to better
test these paths increase code coverage.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
|