{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1745906952,
"reponame":"cgit",
"desc":"CGI gitweb",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/cgit",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"a4db4c478eb23388ef0a53671277badd",
"commit": {"type":"commit",
"time": 1530230000,
"time_ofs": 480,
"oid_tree": { "oid": "500d7db1ef57951d5b550fa73dff222735e04e44", "alias": []},
"oid":{ "oid": "2d789a817bd580670107125cb312e33a24bf8045", "alias": []},
"msg": "gcc8.1: fix strncpy bounds warnings",
"sig_commit": { "git_time": { "time": 1530230000, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1530008996, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "gcc8.1: fix strncpy bounds warnings\n\nThese warnings are coming on default Fedora 28 build and probably others using gcc 8.1\n\n../shared.c: In function ‘expand_macro’:\n../shared.c:483:3: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow\u003d]\n strncpy(name, value, len);\n ^~~~~~~~~~~~~~~~~~~~~~~~~\n../shared.c:480:9: note: length computed here\n len \u003d strlen(value);\n ^~~~~~~~~~~~~\n\nstrncpy with a computed length via strlen is usually\nnot the right thing.\n\nSigned-off-by: Andy Green \u003candy@warmcat.com\u003e"
,
"diff": "diff --git a/shared.c b/shared.c\nindex d7c7636..6cda79e 100644\n--- a/shared.c\n+++ b/shared.c\n@@ -483,7 +483,7 @@ static char *expand_macro(char *name, int maxlength)\n \t\tlen \u003d strlen(value);\n \t\tif (len \u003e maxlength)\n \t\t\tlen \u003d maxlength;\n-\t\tstrncpy(name, value, len);\n+\t\tmemcpy(name, value, len);\n \t}\n \treturn name + len;\n }\n","s":{"c":1745906952,"u": 1024}}
],"g": 2396,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}