<div dir="ltr">Hi,<div><p class="gmail-p1" style="color:rgb(0,0,0)">I noticed that after commit<span class="gmail-Apple-converted-space"> </span><a href="https://github.com/file/file/commit/6bc6cf03ad4ad136088260e22f30c6d191c161a3">6bc6cf03ad4ad136088260e22f30c6d191c161a3</a>, the ELF magic results have changed. Specifically, in the test data at<span class="gmail-Apple-converted-space"> </span><a href="https://github.com/file/file-tests/tree/master/db/elf">file-tests/db/elf</a>, the following difference occurs:</p><p class="gmail-p1" style="color:rgb(0,0,0)">--- reference/elf/a.ref  2025-05-13 13:52:48.260986955 +0000<br>+++ /tmp/tmp.lcLqsYkBCU/out        2025-05-13 13:53:14.249232572 +0000<br>@@ -1 +1 @@<br>-ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=f382d7105a1c1d2b42db80c4202ea7a84c59b335, not stripped<br>+ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter *empty*, for GNU/Linux 2.6.32, BuildID[sha1]=f382d7105a1c1d2b42db80c4202ea7a84c59b335, not stripped<br></p></div><div><span style="color:rgb(0,0,0)">Upon reviewing the commit, I suspect a copy-paste mistake in the following lines:</span></div><div>   else<br></div><div>-        strlcpy(interp, "*empty*", sizeof(interp));<br>+       str = "*empty*";<br>+                 strlcpy(interp, "*empty*", sizeof(interp));<br></div><div><br></div><div><p class="gmail-p1" style="color:rgb(0,0,0)">The<span class="gmail-Apple-converted-space"> </span><span class="gmail-s1">strlcpy</span><span class="gmail-Apple-converted-space"> </span>call should use the<span class="gmail-Apple-converted-space"> </span><span class="gmail-s1">str</span><span class="gmail-Apple-converted-space"> </span>variable as its source argument, not the literal string<span class="gmail-Apple-converted-space"> </span><span class="gmail-s1">"*empty*"</span>. The corrected code should be:</p><div>   else<br></div><div>-        strlcpy(interp, "*empty*", sizeof(interp));<br>+       str = "*empty*";<br>+ strlcpy(interp, str, sizeof(interp));</div><div><br></div><p class="gmail-p1" style="color:rgb(0,0,0)">best regards,</p><p class="gmail-p1" style="color:rgb(0,0,0)">Vincent Mihalkovic</p></div></div>