Fix code scanning alert no. 97: Wrong type of arguments to formatting function (#41)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 133: Redundant null check due to previous dereference (#40)
* Update windDisp.c
* DLM - AI wanted to guard the '*area' dereference in if() statement, but the code path above has address of '&' operator for the assignment to 'area' so it must always be non-null. So I rejected this approach and removed the extra null check, replacing it with an assert().
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 132: Redundant null check due to previous dereference (#39)
* Update DBio.c
* AI wanted to move guard 'pathptr != NULL' up to 1953, but it is assigned to guaranteed non-null in every assignment above and only incremented or dereferenced.
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 64: Too few arguments to formatting function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 23: Call to function with fewer arguments than declared parameters (#38)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This is a complete guess based on function parameter types and the locallity of the 'pNum' value.
This error predates the 2017 Initial Commit git history.
Copilot Autofix rejected: extEnumTilePerim(tile, devptr->exts_deviceSDTypes[i],
SimTransTerms, (ClientData) &transistor, (ClientData) NULL );
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/26
Fix code scanning alert no. 129: Wrong type of arguments to formatting function (#24)
* Update windDebug.c
* AI wanted "%p", DLM changed to (intmax_t) "%lx"
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Fix code scanning alert no. 99: Wrong type of arguments to formatting function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Update grouteMaze.c
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 100: Wrong type of arguments to formatting function (#31)
* Update grouteTest.c
* AI suggested just "%p", DLM modified to used intmax_t cast.
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 61: Too few arguments to formatting function (#35)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 60: Too few arguments to formatting function (#36)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Wrong type of arguments to formatting function
Looks like SPICE comment, change maintains hex without 0x prefix in portable way.
Copilot Autofix rejected: TxPrintf("%p\n", tp);
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/65
Wrong type of arguments to formatting function
Looks like SPICE comment, change maintains hex without 0x prefix in portable way.
Copilot Autofix rejected: TxError("** %s (%p)\n", nsn, node);
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/70
Fix code scanning alert no. 140: Incorrect return-value check for a 'scanf'-like function (#23)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 138: Incorrect return-value check for a 'scanf'-like function (#22)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 109: Wrong type of arguments to formatting function (#27)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 106: Wrong type of arguments to formatting function (#30)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 104: Wrong type of arguments to formatting function (#29)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 103: Wrong type of arguments to formatting function (#28)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 66: Wrong type of arguments to formatting function (#33)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
The 'predefined' pointer argument to calmaFindCell() is for an optional return value, so must be
NULL when feature is not used.
Copilot Autofix rejected: newdef = calmaFindCell(newname, someSecondArgument);
calma/CalmaRdcl.c
1c822652 (2020-12-04 16:56:51 -0500 1359) bool *predefined; /* If this cell was in memory before the GDS
1c822652 (2020-12-04 16:56:51 -0500 1360) * file was read, then this flag gets set.
1c822652 (2020-12-04 16:56:51 -0500 1361) */
commit 1c82265244 (tag: mpw-one-a, tag: 8.3.92)
Date: Fri Dec 4 16:56:51 2020 -0500
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/6https://github.com/dlmiles/magic/security/code-scanning/5
The 'isvalid' pointer argument to CmdFindNetProc() is for an optional return value, so must be
NULL when feature is not used.
Copilot Autofix rejected: ttype = CmdFindNetProc(netname, CIFDummyUse, &bbox, FALSE, additional_arg1, additional_arg2);
commands/CmdFI.c
cfb81101 (2022-03-30 13:02:12 -0400 1584) bool *isvalid;
commit f89d52dbcc (tag: 8.3.253)
Date: Thu Jan 6 13:29:43 2022 -0500
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/7
gparams.rg_ttype seems to be the only value of the correct type that has connectivity with the callsite.
Copilot Autofix rejected: ResGetDevice(gparams.rg_devloc, /* second argument */);
resis/ResSimple.c
9aa39f82 (2021-05-25 22:41:52 -0400 1039) resDevice *res = ResGetDevice(gparams.rg_devloc);
commit 9aa39f820f (tag: 8.3.169)
Date: Tue May 25 22:41:52 2021 -0400
The 'isvalid' pointer argument to CmdFindNetProc() is for an optional return value, so must be
NULL when feature is not used.
Copilot Autofix rejected: ttype = CmdFindNetProc(lab1, use, &rect, FALSE, additionalArg);
commands/CmdFI.c
cfb81101 (2022-03-30 13:02:12 -0400 1584) bool *isvalid;
commit f89d52dbcc (tag: 8.3.253)
Date: Thu Jan 6 13:29:43 2022 -0500
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/25
Looks like -1 is accepted as placeholder, maybe it should be the
temporary->fn (filename mtime?).
Copilot Autofix rejected: LefRead(temporary->fn, FALSE, NULL);
related git blame utils/main.c:
8e80644d (2022-01-22 13:30:11 -0500 2078) int lefTimestamp; /* If not -1, use the value pointed to
8e80644d (2022-01-22 13:30:11 -0500 2884) int lefTimestamp;
related commit:
commit 8e80644dd7
Date: Sat Jan 22 13:30:11 2022 -0500
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/28
Copilot Autofix rejected: DBFileRecovery(MainFileName);
database/DBio.c looks to take NULL as a value for automatic recovery.
Related commits:
commit 231a299b16 (tag: 8.2.0)
Date: Tue Apr 25 08:41:48 2017 -0400
Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky
No AI resolution.
The NULL added is cdata which looks to be opaque callback user-defined-pointer,
this is not used in the method printPropertiesFunc() as a possible 3rd argument.
CodeQL: https://github.com/dlmiles/magic/security/code-scanning/157
Fix code scanning alert no. 120: Wrong type of arguments to formatting function (#17)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 117: Wrong type of arguments to formatting function (#16)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 116: Wrong type of arguments to formatting function (#19)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 115: Wrong type of arguments to formatting function (#20)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 114: Wrong type of arguments to formatting function (#21)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 10: Call to function with fewer arguments than declared parameters (#14)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 9: Call to function with fewer arguments than declared parameters (#15)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 134: Incorrect return-value check for a 'scanf'-like function (#13)
* Create codeql.yml
* Fix code scanning alert no. 134: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 135: Incorrect return-value check for a 'scanf'-like function (#12)
* Create codeql.yml
* Fix code scanning alert no. 135: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 136: Incorrect return-value check for a 'scanf'-like function (#11)
* Create codeql.yml
* Fix code scanning alert no. 136: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 149: Incorrect return-value check for a 'scanf'-like function (#10)
* Create codeql.yml
* Fix code scanning alert no. 149: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 137: Incorrect return-value check for a 'scanf'-like function (#9)
* Create codeql.yml
* Fix code scanning alert no. 137: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 150: Incorrect return-value check for a 'scanf'-like function (#8)
* Create codeql.yml
* Fix code scanning alert no. 150: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Update grCMap.c
* AI suggested '< 1', DLM edited to '<= 0' easier for a human to reason about ?
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 151: Incorrect return-value check for a 'scanf'-like function (#7)
* Create codeql.yml
* Fix code scanning alert no. 151: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Update grDStyle.c
* AI suggested '< 1', DLM edited to '<= 0' easier for a human to reason about ?
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Fix code scanning alert no. 156: Incorrect return-value check for a 'scanf'-like function (#6)
* Create codeql.yml
* Fix code scanning alert no. 156: Incorrect return-value check for a 'scanf'-like function
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>