Skip to content

Commit 047ce0b

Browse files
committed
iiaf
1 parent 30f4c73 commit 047ce0b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libr/core/canal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,15 @@ static int is_string(const ut8 *buf, int size, int *len) {
167167
static bool is_cfstring_or_pstring(RCore *core, char *str, int size, int *len) {
168168
ut64 v0 = r_read_at_le64 (str, 0);
169169
ut64 v1 = r_read_at_le64 (str, 8);
170-
ut64 v2 = r_read_at_le64 (str, 16);
170+
const ut64 v2 = r_read_at_le64 (str, 16);
171171
if (!v0) {
172172
v0 = v2;
173173
v1 = 0;
174174
}
175175
if (v1 < 0x1000 && v2) {
176-
ut64 ptr = v2;
177-
r_io_read_at (core->io, ptr, (ut8*)str, size);
176+
if (r_io_read_at (core->io, v2, (ut8*)str, size) < 1) {
177+
return false;
178+
}
178179
str[size] = 0;
179180
return is_string ((ut8*)str, size, len);
180181
}

0 commit comments

Comments
 (0)