Skip to content

Commit cad9cc2

Browse files
authored
Use rz_buf_new_file when loading PDB & FLIRT files. (#5161)
* Don't use `rz_buf_new_slurp` for PDB * Do not use `rz_buf_new_slurp` for FLIRT.
1 parent d236de2 commit cad9cc2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

librz/bin/pdb/pdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ bool is_compressed_pdb(RzBuffer *buf) {
305305
*/
306306
RZ_API RZ_OWN RzPdb *rz_bin_pdb_parse_from_file(RZ_NONNULL const char *filename) {
307307
rz_return_val_if_fail(filename, NULL);
308-
RzBuffer *buf = rz_buf_new_slurp(filename);
308+
RzBuffer *buf = rz_buf_new_file(filename, O_RDONLY, 0);
309309
if (!buf) {
310310
RZ_LOG_ERROR("%s: Error reading file \"%s\"\n", __FUNCTION__, filename);
311311
return false;

librz/core/csign.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ RZ_API bool rz_core_flirt_dump_file(RZ_NONNULL const char *flirt_file) {
384384
RzBuffer *buffer = NULL;
385385
RzFlirtNode *node = NULL;
386386

387-
if (!(buffer = rz_buf_new_slurp(flirt_file))) {
387+
if (!(buffer = rz_buf_new_file(flirt_file, O_RDONLY, 0))) {
388388
RZ_LOG_ERROR("FLIRT: cannot open %s (read mode)\n", flirt_file);
389389
return false;
390390
} else if (!strcmp(extension, ".pat")) {
@@ -539,7 +539,7 @@ RZ_API bool rz_core_flirt_convert_file(RZ_NONNULL RzCore *core, RZ_NONNULL const
539539
return false;
540540
}
541541

542-
if (!(buffer = rz_buf_new_slurp(input_file))) {
542+
if (!(buffer = rz_buf_new_file(input_file, O_RDONLY, 0))) {
543543
RZ_LOG_ERROR("FLIRT: cannot open %s (read mode)\n", input_file);
544544
return false;
545545
} else if (!strcmp(in_extension, ".pat")) {

librz/sign/flirt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ RZ_API bool rz_sign_flirt_apply(RZ_NONNULL RzAnalysis *analysis, RZ_NONNULL cons
13261326
return false;
13271327
}
13281328

1329-
if (!(flirt_buf = rz_buf_new_slurp(flirt_file))) {
1329+
if (!(flirt_buf = rz_buf_new_file(flirt_file, O_RDONLY, 0))) {
13301330
RZ_LOG_ERROR("FLIRT: Can't open %s\n", flirt_file);
13311331
return false;
13321332
}

0 commit comments

Comments
 (0)