The following issues were found

aten/src/ATen/cpu/vec/vec256/vec256_complex_float.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 127 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  for (auto i = 0; i < 2*size(); ++i) {
      tmp_values[i] = 0.0;
    }
    std::memcpy(
        tmp_values,
        reinterpret_cast<const float*>(ptr),
        count * sizeof(c10::complex<float>));
    return _mm256_load_ps(tmp_values);
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 139 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  } else if (count > 0) {
      float tmp_values[2*size()];
      _mm256_storeu_ps(reinterpret_cast<float*>(tmp_values), values);
      std::memcpy(ptr, tmp_values, count * sizeof(c10::complex<float>));
    }
  }
  const c10::complex<float>& operator[](int idx) const  = delete;
  c10::complex<float>& operator[](int idx) = delete;
  Vectorized<c10::complex<float>> map(c10::complex<float> (*const f)(const c10::complex<float> &)) const {

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vec256_double.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 78 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  for (auto i = 0; i < size(); ++i) {
      tmp_values[i] = 0.0;
    }
    std::memcpy(
        tmp_values,
        reinterpret_cast<const double*>(ptr),
        count * sizeof(double));
    return _mm256_load_pd(tmp_values);
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 90 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  } else if (count > 0) {
      double tmp_values[size()];
      _mm256_storeu_pd(reinterpret_cast<double*>(tmp_values), values);
      std::memcpy(ptr, tmp_values, count * sizeof(double));
    }
  }
  const double& operator[](int idx) const  = delete;
  double& operator[](int idx) = delete;
  int zero_mask() const {

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vec256_float.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 86 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  for (auto i = 0; i < size(); ++i) {
      tmp_values[i] = 0.0;
    }
    std::memcpy(
        tmp_values, reinterpret_cast<const float*>(ptr), count * sizeof(float));
    return _mm256_loadu_ps(tmp_values);
  }
  void store(void* ptr, int64_t count = size()) const {
    if (count == size()) {

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 96 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  } else if (count > 0) {
      float tmp_values[size()];
      _mm256_storeu_ps(reinterpret_cast<float*>(tmp_values), values);
      std::memcpy(ptr, tmp_values, count * sizeof(float));
    }
  }
  const float& operator[](int idx) const  = delete;
  float& operator[](int idx) = delete;
  int zero_mask() const {

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vec256_float_neon.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 227 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    for (auto i = 0; i < size(); ++i) {
        tmp_values[i] = 0.0;
      }
      std::memcpy(
          tmp_values,
          reinterpret_cast<const float*>(ptr),
          count * sizeof(float));
      return vld1q_f32_x2(reinterpret_cast<const float*>(tmp_values));
    }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 244 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  else {
      float tmp_values[size()];
      vst1q_f32_x2(reinterpret_cast<float*>(tmp_values), values);
      std::memcpy(ptr, tmp_values, count * sizeof(float));
    }
  }
  inline const float32x4_t& get_low() const {
    return values.val[0];
  }

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vsx/vec256_complex_double_vsx.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 145 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }

    __at_align__ value_type tmp_values[size()];
    std::memcpy(tmp_values, ptr, std::min(count, size()) * sizeof(value_type));

    return {
        vec_vsx_ld(offset0, reinterpret_cast<const double*>(tmp_values)),
        vec_vsx_ld(offset16, reinterpret_cast<const double*>(tmp_values))};
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 159 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    __at_align__ value_type tmp_values[size()];
      vec_vsx_st(_vec0, offset0, reinterpret_cast<double*>(tmp_values));
      vec_vsx_st(_vec1, offset16, reinterpret_cast<double*>(tmp_values));
      std::memcpy(
          ptr, tmp_values, std::min(count, size()) * sizeof(value_type));
    }
  }

  const ComplexDbl& operator[](int idx) const = delete;

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vsx/vec256_complex_float_vsx.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 200 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }

    __at_align__ value_type tmp_values[size()];
    std::memcpy(tmp_values, ptr, std::min(count, size()) * sizeof(value_type));

    return {
        vec_vsx_ld(offset0, reinterpret_cast<const float*>(tmp_values)),
        vec_vsx_ld(offset16, reinterpret_cast<const float*>(tmp_values))};
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 215 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    __at_align__ value_type tmp_values[size()];
      vec_vsx_st(_vec0, offset0, reinterpret_cast<float*>(tmp_values));
      vec_vsx_st(_vec1, offset16, reinterpret_cast<float*>(tmp_values));
      std::memcpy(
          ptr, tmp_values, std::min(count, size()) * sizeof(value_type));
    }
  }

  const ComplexFlt& operator[](int idx) const = delete;

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vsx/vec256_double_vsx.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 173 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }

    __at_align__ value_type tmp_values[size()];
    std::memcpy(tmp_values, ptr, std::min(count, size()) * sizeof(value_type));

    return {vec_vsx_ld(offset0, tmp_values), vec_vsx_ld(offset16, tmp_values)};
  }
  void C10_ALWAYS_INLINE store(void* ptr, int count = size()) const {
    if (count == size()) {

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 185 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    __at_align__ value_type tmp_values[size()];
      vec_vsx_st(_vec0, offset0, tmp_values);
      vec_vsx_st(_vec1, offset16, tmp_values);
      std::memcpy(
          ptr, tmp_values, std::min(count, size()) * sizeof(value_type));
    }
  }
  const double& operator[](int idx) const = delete;
  double& operator[](int idx) = delete;

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vsx/vec256_float_vsx.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 184 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }

    __at_align__ value_type tmp_values[size()];
    std::memcpy(tmp_values, ptr, std::min(count, size()) * sizeof(value_type));

    return {vec_vsx_ld(offset0, tmp_values), vec_vsx_ld(offset16, tmp_values)};
  }
  void C10_ALWAYS_INLINE store(void* ptr, int count = size()) const {
    if (count == size()) {

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 196 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    __at_align__ value_type tmp_values[size()];
      vec_vsx_st(_vec0, offset0, tmp_values);
      vec_vsx_st(_vec1, offset16, tmp_values);
      std::memcpy(
          ptr, tmp_values, std::min(count, size()) * sizeof(value_type));
    }
  }

  const float& operator[](int idx) const = delete;

            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vsx/vec256_int16_vsx.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 273 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }

    __at_align__ value_type tmp_values[size()];
    std::memcpy(tmp_values, ptr, std::min(count, size()) * sizeof(value_type));

    return {vec_vsx_ld(offset0, tmp_values), vec_vsx_ld(offset16, tmp_values)};
  }
  void C10_ALWAYS_INLINE store(void* ptr, int count = size()) const {
    if (count == size()) {

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 285 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    __at_align__ value_type tmp_values[size()];
      vec_vsx_st(_vec0, offset0, tmp_values);
      vec_vsx_st(_vec1, offset16, tmp_values);
      std::memcpy(ptr, tmp_values, std::min(count, size()) * sizeof(value_type));
    }
  }
  const int16_t& operator[](int idx) const = delete;
  int16_t& operator[](int idx) = delete;


            

Reported by FlawFinder.

aten/src/ATen/cpu/vec/vec256/vsx/vec256_int32_vsx.h
2 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 203 Column: 10 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }

    __at_align__ value_type tmp_values[size()];
    std::memcpy(tmp_values, ptr, std::min(count, size()) * sizeof(value_type));

    return {vec_vsx_ld(offset0, tmp_values), vec_vsx_ld(offset16, tmp_values)};
  }
  void C10_ALWAYS_INLINE store(void* ptr, int count = size()) const {
    if (count == size()) {

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 215 Column: 12 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    __at_align__ value_type tmp_values[size()];
      vec_vsx_st(_vec0, offset0, tmp_values);
      vec_vsx_st(_vec1, offset16, tmp_values);
      std::memcpy(
          ptr, tmp_values, std::min(count, size()) * sizeof(value_type));
    }
  }
  const int32_t& operator[](int idx) const = delete;
  int32_t& operator[](int idx) = delete;

            

Reported by FlawFinder.