ostree_raw_file_to_content_stream: Make size default to 0
authorSimon McVittie <smcv@collabora.com>
Fri, 17 Mar 2023 12:53:42 +0000 (12:53 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 17 Mar 2023 12:53:42 +0000 (12:53 +0000)
commit722a4179f36439a01faf4afa33201ddd2f3ca46a
treeebf3a36668f4933a5ba14a75ce34a9915e66e567
parent4238ef4c685c138305a3ee017330bc6938f407f2
ostree_raw_file_to_content_stream: Make size default to 0

Some existing code calls into ostree_raw_file_to_content_stream() with
file objects that do not have the standard::size attribute. Since GLib
2.76.0, attempting to access the size of such an object raises a
critical warning. Handle this more gracefully by defaulting the size
to 0, like earlier versions of GLib did.

Signed-off-by: Simon McVittie <smcv@collabora.com>
src/libostree/ostree-core.c