Whamcloud - gitweb
LU-10141 llapi: integer overflow in llapi_changelog_start
[fs/lustre-release.git] / lustre / utils / liblustreapi_chlg.c
index f4661be..d9c7af0 100644 (file)
@@ -117,8 +117,10 @@ int llapi_changelog_start(void **priv, enum changelog_send_flag flags,
        }
 
        if (startrec != 0) {
-               rc = lseek(cp->clp_fd, startrec, SEEK_SET);
-               if (rc < 0) {
+               off_t res;
+
+               res = lseek(cp->clp_fd, startrec, SEEK_SET);
+               if (res == (off_t)-1) {
                        rc = -errno;
                        goto out_close;
                }