error: passing a negative value to an os_errno is wrong
PATCH v4 1/1 error: passing a negative value to an os_errno is wrong
Added 'assert(os_errno >= 0)' in 'error_set_errno()'.
Signed-off-by SeokYeon Hwang <[email protected]>
--- util/error.c | 1 + 1 file changed, 1 insertion(+)
util/error.c +1 -0
@@ -62,6 +62,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,return ; }assert (*errp ==NULL ); +assert (os_errno >=0 ); err =g_malloc0 (sizeof (*err));
Signature · 1 line
2.1.0
Quoted 12 lines · SeokYeon Hwang
Added '
assert(os_errno >= 0)' in 'error_set_errno()'.Signed-off-by SeokYeon Hwang <[email protected]>--- util/error.c | 1 + 1 file changed, 1 insertion(+)util/error.c +0
-0
util/error.c void error_set_errno(Error **errp, int os_errno, ErrorClass err_class, · line 67
Quoted 6 lines
util/error.c +1
-0@@ -62,6 +62,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,return ; }assert (*errp ==NULL ); +assert (os_errno >=0 ); err =g_malloc0 (sizeof (*err));
Too risky for 2.2 at this stage, but fine for 2.3.
Reviewed-by Markus Armbruster <[email protected]>
Quoted 12 lines · SeokYeon Hwang
Added '
assert(os_errno >= 0)' in 'error_set_errno()'.Signed-off-by SeokYeon Hwang <[email protected]>--- util/error.c | 1 + 1 file changed, 1 insertion(+)util/error.c +0
-0
util/error.c void error_set_errno(Error **errp, int os_errno, ErrorClass err_class, · line 68
Quoted 7 lines
util/error.c +1
-0@@ -62,6 +62,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,return ; }assert (*errp ==NULL ); +assert (os_errno >=0 ); err =g_malloc0 (sizeof (*err));
Reviewed-by Max Reitz <[email protected]>