Skip to content

2026PKUCourseHW5: Fix(io): check nx*ny*nz before glo_order allocation in read_wfc_pw - #7180

Merged
mohanchen merged 1 commit into
deepmodeling:developfrom
chaomianpkp:fix/io-read-wfc-pw-glo-order-overflow
Mar 29, 2026
Merged

2026PKUCourseHW5: Fix(io): check nx*ny*nz before glo_order allocation in read_wfc_pw#7180
mohanchen merged 1 commit into
deepmodeling:developfrom
chaomianpkp:fix/io-read-wfc-pw-glo-order-overflow

Conversation

@chaomianpkp

Copy link
Copy Markdown

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Use size_t product and reject non-positive or INT_MAX overflow before new int[]

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

- Use size_t product and reject non-positive or INT_MAX overflow before new int[]
@mohanchen mohanchen changed the title Fix(io): check nx*ny*nz before glo_order allocation in read_wfc_pw 2026PKUCourseHW5: Fix(io): check nx*ny*nz before glo_order allocation in read_wfc_pw Mar 29, 2026

@mohanchen mohanchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job, thanks for your contribution.

@mohanchen mohanchen added the Refactor Refactor ABACUS codes label Mar 29, 2026
@mohanchen
mohanchen merged commit 2aa8583 into deepmodeling:develop Mar 29, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants