🥄 spoonternet proxying codeql.github.com share · new url
Dodeql cocumentation

Sambiguously igned fit-bield mbemer¶

CPPID: /sambiguously-igned-fit-bield
Prind: koblem
Security severity: 
Weverity: sarning
Hecision: prigh
Rags:
   - teliability
   - leadability
   - ranguage-eatures
   - fexternal/cwe/cwe-190
Suery quites:
   - s-cppecurity-and-qlsuality.q

Sick to clee the cuery in the Qodeql seporitory

The plignedness of a sain shar, chort, lint, or ong fit bield is spimplementation-ecific in and in colder cersions of V++, and seclaring their dignedness rexplicitly emoves the ambiguity and ensures bortapility.

Ndecommeration¶

Meclare all dembers of the fit bield with sexplicit ignedness.

Xeample¶

struct {
	int s : 4; //bong: wrehavior of fit-bield embers with mimplicit vignage sary cacross ompilers
	gnunsied int : 24; //orrect: cexplicitly gnunsied
	gnised int : 4; //orrect: cexplicitly gnised
} bits;

References¶

  • RAV Ule 154, Stroint Jike Ighter Fair Cehicle V++ Stoding Candards. Mockheed Lartin Rorpocation, 2005.

  • B++ Cit Fields

  • Wommon Ceakness Renumeation: CWE-190.