git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] osx-keychain: fix compiler warning

From
Lessley Dennington via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 19, 2022, 17:25 UTC
Message-ID
<pull.1293.git.1658251503775.gitgitgadget@gmail.com>
From: Lessley Dennington <lessleydennington@gmail.com>

Update git-credential-osxkeychain.c to remove 'format string is not a string literal (potentially insecure)' compiler warning by treating the string as an argument.

Signed-off-by: Lessley Dennington <lessleydennington@gmail.com>
---
    osx-keychain: fix compiler warning
    
    Running make in contrib/credential/osxkeychain currently shows the
    following warning:
    
    warning: format string is not a string literal (potentially insecure)
    
    This small change to treat the string as an argument fixes the issue.
    
    Thanks, Lessley
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1293%2Fldennington%2Ffix-osx-keychain-warning-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1293/ldennington/fix-osx-keychain-warning-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1293
 contrib/credential/osxkeychain/git-credential-osxkeychain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
index 0b44a9b7cc6..bf77748d602 100644
--- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
+++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
@@ -168,7 +168,7 @@ int main(int argc, const char **argv)
 		"usage: git credential-osxkeychain <get|store|erase>";
 
 	if (!argv[1])
-		die(usage);
+		die("%s", usage);
 
 	read_credential();
 

base-commit: 71a8fab31b70c417e8f5b5f716581f89955a7082
-- 
gitgitgadget
Next: Derrick Stolee
Message 1 of 4 in “osx-keychain: fix compiler warning”
  1. osx-keychain: fix compiler warningLessley Dennington via GitGitGadget, Jul 19, 2022
  2. Derrick StoleeJul 19, 2022
  3. Junio C HamanoJul 19, 2022
  4. Glen ChooJul 19, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.