]> wimlib.net Git - wimlib/commitdiff
wimlib_export_image(): error if src_wim == dest_wim
authorEric Biggers <ebiggers3@gmail.com>
Sat, 2 May 2015 22:40:06 +0000 (17:40 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 2 May 2015 23:13:41 +0000 (18:13 -0500)
src/export_image.c

index e88107a96030f6cae0aa646d48bc5dc673361f99..8ad2d533644f86c0ba73ad5f3fd8f4105cbf740a 100644 (file)
@@ -128,7 +128,7 @@ wimlib_export_image(WIMStruct *src_wim,
                             WIMLIB_EXPORT_FLAG_WIMBOOT))
                return WIMLIB_ERR_INVALID_PARAM;
 
                             WIMLIB_EXPORT_FLAG_WIMBOOT))
                return WIMLIB_ERR_INVALID_PARAM;
 
-       if (src_wim == NULL || dest_wim == NULL)
+       if (!src_wim || !dest_wim || src_wim == dest_wim)
                return WIMLIB_ERR_INVALID_PARAM;
 
        if (!wim_has_metadata(src_wim) || !wim_has_metadata(dest_wim))
                return WIMLIB_ERR_INVALID_PARAM;
 
        if (!wim_has_metadata(src_wim) || !wim_has_metadata(dest_wim))