| 1249 | } |
| 1250 | |
| 1251 | bool Library::isuninitargbad(const Token *ftok, int argnr, int indirect, bool *hasIndirect) const |
| 1252 | { |
| 1253 | const ArgumentChecks *arg = getarg(ftok, argnr); |
| 1254 | if (!arg) { |
| 1255 | // non-scan format string argument should not be uninitialized |
| 1256 | const std::string funcname = getFunctionName(ftok); |
| 1257 | const auto it = utils::as_const(mData->mFunctions).find(funcname); |
| 1258 | if (it != mData->mFunctions.cend() && it->second.formatstr && !it->second.formatstr_scan) |
| 1259 | return true; |
| 1260 | } |
| 1261 | if (hasIndirect && arg && arg->notuninit >= 1) |
| 1262 | *hasIndirect = true; |
| 1263 | return arg && arg->notuninit >= indirect; |
| 1264 | } |
| 1265 | |
| 1266 | |
| 1267 | /** get allocation info for function */ |