JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.2p0 | CONFIDENTIAL | CodeSecure Inc |
チェックされていない乗算によるメモリ割り当てサイズの計算は、 整数オーバーフローを起こし予期せず割り当てブロックサイズが小さくなる危険性があります。
(注:乗算オーバーフローがメモリ割り当て以外の命令で使用するサイズの計算に影響する場合は、 代わりに (サイズの乗算オーバーフロー) が適用されます)
一般的に、 割り当てサイズの整数オーバーフロー (Integer Overflow of Allocation Size) の上位集合となります。 但し、C++ の new[] 内で暗黙的に乗算される場合を除きます(この場合は、割り当てサイズの整数オーバーフローを引き起こしますが、割り当てサイズの乗算オーバーフローは引き起こしません)。
| クラス名 | Multiplication Overflow of Allocation Size | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 割り当てサイズの乗算オーバーフロー | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| クラス分類 | セキュリティ (security) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ニーモニック | ALLOC.SIZE.MULOFLOW | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Multiplication Overflow of Allocation Size" |
#include <stdlib.h>
int do_muloflow_alloc(int x, int y)
{
char *p = malloc(x*y); /* 'Multiplication Overflow of Allocation Size' warning issued here. */
/* 'Integer Overflow of Allocation Size' warning also issued */
int rv = 0;
if (p){
rv = 1;
free(p);
}
return rv;
}
Multiplication Overflow of Allocation Size warnings can be triggered by any function treated as an allocator by CodeSonar:
割り当てサイズの加算オーバーフロー、割り当てサイズの乗算オーバーフロー、割り当てサイズの減算アンダーフロー、割り当てサイズの切り捨ての各クラスは、同じトリガー関数が適用されます。
CodeSonar はワーニングの実行パス (core path) に入る前に与えられる整数値の制約は考慮していません。
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。
To report problems with this documentation, please visit https://support.codesecure.com/.