Skip to content

criu_check_version() failure check missing #2029

@eriksjolund

Description

@eriksjolund

The following code does not check whether an error occured

crun/src/libcrun/criu.c

Lines 544 to 545 in 4a26a1a

if (! libcriu_wrapper->criu_check_version (LIBCRIU_MIN_VERSION))
return crun_make_error (err, 0, "libcriu is too old");

See criu_check_version() header:

/*
 * Check if the version of the CRIU binary is at least
 * 'minimum'. Version has to be in the same format as
 * described for criu_get_version().
 *
 * Returns 1 if CRIU is at least 'minimum'.
 * Returns 0 if CRIU is too old.
 * Returns < 0 if there was an error.
 */
int criu_check_version(int minimum);

quote from

https://github.com/checkpoint-restore/criu/blob/c180188db036f8ea4c08bfee28cbcdbdd52cdfc3/lib/c/criu.h#L206-L215

I noticed this when reading the source code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions