Archived
Pretty: fix use of uninitialised variable
The string chunk getter doesn't set ptr if there was an error decoding. Instead, we need to deal with the error first. Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
+3
-1
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 Intel Corporation
|
||||
** Copyright (C) 2019 Intel Corporation
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
** of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -422,6 +422,8 @@ static CborError value_to_pretty(CborStreamFunction stream, void *out, CborValue
|
||||
}
|
||||
|
||||
err = _cbor_value_get_string_chunk(it, &ptr, &n, it);
|
||||
if (err)
|
||||
return err;
|
||||
if (!ptr)
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user