shithub: scc

Download patch

ref: 9f9c8e6fbc77dcd69e833d1d1907d4dcb60b20b3
parent: 448edca819fa4d00ce307dca80bc4398150ec8e6
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Mon Mar 12 16:34:30 EDT 2018

[nm] Fix detection of member in archives

The old code was using the additional '\0'.

--- a/nm/main.c
+++ b/nm/main.c
@@ -69,7 +69,7 @@
 
 	while (fread(&hdr, sizeof(hdr), 1, fp) == 1) {
 		pos = ftell(fp);
-		if (strncmp(hdr.ar_fmag, ARFMAG, SARMAG))
+		if (strncmp(hdr.ar_fmag, ARFMAG, sizeof(hdr.ar_fmag)))
 			goto corrupted;
 
 		siz = 0;