diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-06-15 14:07:46 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-06-15 14:07:46 -0700 |
| commit | 1239060641b3a33eeefd7f72c3a53995916e01d8 (patch) | |
| tree | 1316d3b892b07223c9e833e4acb504f6919fb5b6 | |
| parent | 5b1344db44a5caffd58a631ead7f7a3736d6bb90 (diff) | |
Fix for free-after-use caused by hardlinked files (reverting earlier
change that assumed files with equal inode/idev were the same)
| -rw-r--r-- | bb.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -752,7 +752,9 @@ entry_t* load_entry(bb_t *bb, const char *path) // Check for pre-existing: for (entry_t *e = bb->hash[(int)filestat.st_ino & HASH_MASK]; e; e = e->hash.next) { - if (e->info.st_ino == filestat.st_ino && e->info.st_dev == filestat.st_dev) + if (e->info.st_ino == filestat.st_ino && e->info.st_dev == filestat.st_dev + // Need to check filename in case of hard links + && strcmp(pbuf, e->fullname) == 0) return e; } |
