[Rpm-maint] [PATCH 4/4] Removes GNU extension strndup and replaces it with POSIX compliant code.

Giulio Eulisse Giulio.Eulisse at cern.ch
Tue Apr 20 09:43:04 UTC 2010


---
 lib/rpmchecksig.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
-------------- next part --------------
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
index 1b5fca4..040a6f9 100644
--- a/lib/rpmchecksig.c
+++ b/lib/rpmchecksig.c
@@ -593,7 +593,10 @@ static void formatResult(rpmSigTag sigtag, rpmRC sigres, const char *result,
 	if (havekey && (sigres == RPMRC_NOKEY || sigres == RPMRC_NOTTRUSTED)) {
 	    const char *tempKey = strstr(result, "ey ID");
 	    if (tempKey) {
-		char *keyid = strndup(tempKey + 6, 8);
+                char tmp[9];
+                strncpy(tmp, tempKey + 6, 8);
+                tmp[8] = 0;
+		char *keyid = strdup(tmp);
 	    	char *idprob = NULL;
 		rasprintf(&idprob, " %s#%s", signame, keyid);
 		rstrcat(keyprob, idprob);


More information about the Rpm-maint mailing list