Commit Graph

1647 Commits

Author SHA1 Message Date
Darryl L. Miles 29ee094074 graphics/grOGL1.c Dereference of null pointer
Looks like the code below requires mw!=NULL to do anything useful.
So when mw==NULL we don't continue processing X11 Event.

SonarCloud
graphics/grOGL1.c:563 Dereference of null pointer
https://sonarcloud.io/project/issues?open=AZJB16z6NGfDNup0Riss&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles be258c6557 graphics/grOGL1.c: non-void function does not return a value
Making oglSetProjection() return void, like toglSetProjection()

SonarCloud
graphics/grOGL1.c:408 non-void function does not return a value
https://sonarcloud.io/project/issues?open=AZJB16z6NGfDNup0Riro&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles ae0cdd9fea graphics/grClip.c Branch condition evaluates to a garbage value
This is technically a false positive as grClipPoints() will always
initializes a value to ok1 and ok2 when called.  The function is in
the same compile unit, so probably the compiler can see this as well
and potentially not perform the initiailization begin performed in
this commit.

But to quieten and remove this item from the analysis report
assigning an initialization value.

SonarCloud
graphics/grClip.c:451 Branch condition evaluates to a garbage value
https://sonarcloud.io/project/issues?open=AZJB160MNGfDNup0Rit4&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles 10442b6534 graphics/cairo_orig/grTCairo5.c uninitialized local variable
Looks like old code.  Based on cairo_fill() action state this is initialized to
no-op by default.

SonarCloud
graphics/cairo_orig/grTCairo5.c:107 The left operand of '!=' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB16wANGfDNup0RiiZ&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles 5e00e3fe1b graphics/cairo_orig/grTCairo3.c uninitialized value
Looks like old code.  Looks like local variable 'j' could be removed.
Initialization lowers the severity of concern in this area.
The 'j' variable is now written but never read.

SonarCloud
graphics/cairo_orig/grTCairo3.c:492
The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage
https://sonarcloud.io/project/issues?open=AZJB16voNGfDNup0Rig_&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles a9b707460b garouter/gaChannel.c use of unintialized or incorrect variable
This resolution assumes that all records and values of ch->gcr_type are expected
to be one of the 3 cases in the switch.  The bug it on the first iteration it is
possible 'tot' and 'clear' is just not initializaed and on a subsequent iteration
it is possible it ot setup to the previous interation values.

SonarCloud
garouter/gaChannel.c:385:3rd function call argument is an uninitialized value
https://sonarcloud.io/project/issues?open=AZJB17fFNGfDNup0RkoE&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles 543bd5a5b8 ext2sim/sim2simp.c ParseAttr does not return a value
SonarCloud
ext2sim/sim2simp.c:43 non-void function 'parseAttr' should return a value
https://sonarcloud.io/project/issues?open=AZJB17kzNGfDNup0RkzS&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles 973c9a4d1a database/DBio.c read of variable before initialization
Due to FEOF condition and handling it is possible local variable 'c' is not
initialized before being read and compared.

SonarCloud retails
DBio.c:3049 The left operand of '==' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB16rxNGfDNup0Ribf&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles 48853b98a3 calma/CalmaRead.c missing initialization
An FEOF exit path exists in READRH() which causes the output
variable(s) to not be assigned a value, then the code makes
a decision (branch) based on uninitialized data.

SonarCloud detection
CalmaRead.c:359:The left operand of '!=' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB17gSNGfDNup0Rkp5&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles 290887912f ext2spice/ext2hier.c: Wrong type of arguments to formatting function
Applied the same fixes as other commits already merged into file.

Copilot Autofix: Error contact support...

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/38
        https://github.com/dlmiles/magic/security/code-scanning/39
        https://github.com/dlmiles/magic/security/code-scanning/41
2024-10-01 12:36:13 -04:00
Darryl L. Miles 62ebf49758 mzrouter/mzEstimate.c: (intmax_t) %lx Wrong type of arguments to formatting function
Copilot Autofix rejected: TxPrintf("\ntile %p\t\t  (x: %d to %d, y: %d to %d)\n",

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/102
2024-10-01 12:36:13 -04:00
Darryl L. Miles 7509802b3d mzrouter/mzDebug.c: (intmax_t) %lx Wrong type of arguments to formatting function
Copilot Autofix rejected: TxPrintf("tile %p  (x: %d to %d, y: %d to %d)\n"

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/101
2024-10-01 12:36:13 -04:00
Darryl Miles 2c8c60510b plot/plotRutils.c: Multiplication result converted to larger type
Fix code scanning alert no. 56: Multiplication result converted to larger type (#67)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 14a1b21fb6 extract/ExtHier.c: Wrong type of arguments to formatting function
Fix code scanning alert no. 159: Wrong type of arguments to formatting function (#66)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl L. Miles 4dc708aea2 ext2spice/ext2spice.c: Multiplication result converted to larger type
Applying similat fix to others in the file, promote to double ASAP.

Copilot Autofix: Retry and if the problem persists contact support.

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/46
2024-10-01 12:36:13 -04:00
Darryl Miles 98b5f57ea0 ext2spice/ext2spice.c: Multiplication result converted to larger type
Fix code scanning alert no. 48: Multiplication result converted to larger type (#63)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 3becc0e03f ext2spice/ext2spice.c: Multiplication result converted to larger type
Fix code scanning alert no. 47: Multiplication result converted to larger type (#62)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles a6db54c0b7 ext2spice/ext2spice.c: Multiplication result converted to larger type
Fix code scanning alert no. 45: Multiplication result converted to larger type (#61)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 7e04089872 ext2spice/ext2spice.c: Multiplication result converted to larger type
Fix code scanning alert no. 44: Multiplication result converted to larger type (#60)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles cde5418e7d ext2spice/ext2spice.c: Multiplication result converted to larger type
Fix code scanning alert no. 43: Multiplication result converted to larger type (#59)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 9327388ae0 ext2spice/ext2hier.c: Multiplication result converted to larger type
Fix code scanning alert no. 42: Multiplication result converted to larger type (#65)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 147ca7a61f ext2spice/ext2hier.c: Multiplication result converted to larger type
Fix code scanning alert no. 40: Multiplication result converted to larger type (#64)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles fe39d889f0 plot/plotRutils.c: Multiplication result converted to larger type
Fix code scanning alert no. 54: Multiplication result converted to larger type (#56)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 86a6551f9b ext2spice/ext2hier.c: Multiplication result converted to larger type
Fix code scanning alert no. 37: Multiplication result converted to larger type (#58)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 82bec60ccf ext2spice/ext2hier.c: Multiplication result converted to larger type
Fix code scanning alert no. 36: Multiplication result converted to larger type (#57)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 691c27081f drc/DRCcif.c: Multiplication result converted to larger type
Fix code scanning alert no. 34: Multiplication result converted to larger type (#54)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 1fb82e7225 database/DBtiles.c: Multiplication result converted to larger type
Fix code scanning alert no. 30: Multiplication result converted to larger type (#55)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles d8b886aa1d debug/debugFlags.c: Wrong type of arguments to formatting function
Fix code scanning alert no. 67: Wrong type of arguments to formatting function (#45)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 846f2b4cb1 debug/debugFlags.c: Wrong type of arguments to formatting function
Fix code scanning alert no. 68: Wrong type of arguments to formatting function (#46)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 40f96faff8 plot/plotPNM.c: Multiplication result converted to larger type
Fix code scanning alert no. 55: Multiplication result converted to larger type (#47)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 5ffc74d915 lef/defWrite.c: Multiplication result converted to larger type
Fix code scanning alert no. 53: Multiplication result converted to larger type (#48)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 1a351efd56 extract/ExtBasic.c: Multiplication result converted to larger type
Fix code scanning alert no. 52: Multiplication result converted to larger type (#49)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 00086817a4 extract/ExtCouple.c: Multiplication result converted to larger type
Fix code scanning alert no. 51: Multiplication result converted to larger type (#50)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles d6cc790d48 extflat/EFvisit.c: Multiplication result converted to larger type
Fix code scanning alert no. 50: Multiplication result converted to larger type (#51)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 6cae64edc5 drc/DRCbasic.c: Multiplication result converted to larger type
Fix code scanning alert no. 35: Multiplication result converted to larger type (#53)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 5a8cdb68d0 ext2spice/ext2spice.c: Multiplication result converted to larger type
Fix code scanning alert no. 49: Multiplication result converted to larger type (#52)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles f809b2dfac graphics/grTk1.c: Wrong type of arguments to formatting function
Fix code scanning alert no. 98: Wrong type of arguments to formatting function (#44)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 9096946a12 windows/windDebug.c: Wrong type of arguments to formatting function
Fix code scanning alert no. 130: Wrong type of arguments to formatting function (#43)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl Miles 3848ec7b4e extract/ExtHier.c: Wrong type of arguments to formatting function
Fix code scanning alert no. 71: Wrong type of arguments to formatting function (#37)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl L. Miles 2703f55449 extract/ExtTest.c: Too few arguments to formatting function
A bit of a guess based on context.

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/58
        https://github.com/dlmiles/magic/security/code-scanning/59
2024-10-01 12:36:13 -04:00
Darryl Miles 4ddd0624cb gcr/gcrDebug.c: Wrong type of arguments to formatting function
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>
2024-10-01 12:36:13 -04:00
Darryl L. Miles fc20977fa5 gcr/gcrDebug.c: (intmax_t) %ld Wrong type of arguments to formatting function
Mutiple items per line.

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/87
2024-10-01 12:36:13 -04:00
Darryl L. Miles aa703a67b7 resis/ResDebug.c: %.2f Wrong type of arguments to formatting function
Applied same fix as other patch for line below;

Copilot Autofix: did not infer the same fix for same vaiable from line next to it.

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/158
2024-10-01 12:36:13 -04:00
Darryl Miles d1dc038cb7 windows/windDisp.c: Redundant null check due to previous dereference
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>
2024-10-01 12:36:13 -04:00
Darryl Miles 499ac84ac0 database/DBio.c: Redundant null check due to previous dereference
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>
2024-10-01 12:36:13 -04:00
Darryl Miles f976005d2d resis/ResMerge.c: Too few arguments to formatting function
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>
2024-10-01 12:36:13 -04:00
Darryl Miles 3c90bbbe1f lef/defWrite.c: Call to function with fewer arguments than declared parameters
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>
2024-10-01 12:36:13 -04:00
Darryl L. Miles f69b02b092 sim/SimExtract.c: extEnumTilePerim() Call to function with fewer arguments than declared parameters
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
2024-10-01 12:36:13 -04:00
Darryl Miles fdc81f5eec windows/windDebug.c: Wrong type of arguments to formatting function
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>
2024-10-01 12:36:13 -04:00
Darryl Miles cf90d50999 grouter/grouteMaze.c: Wrong type of arguments to formatting function
* 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>
2024-10-01 12:36:13 -04:00