Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libUPnP: Fix memory allocation of size 0 #25373

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

vpeter4
Copy link
Contributor

@vpeter4 vpeter4 commented Jun 25, 2024

Description

fix warning destination object of size 0 allocated by 'operator new []'

In member function 'ReallocateBuffer',
    inlined from 'SetBufferSize' at ../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptDataBuffer.cpp:172:32,
    inlined from 'Load' at ../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptStreams.cpp:106:33:
../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptDataBuffer.cpp:245:23: warning: '__builtin_memcpy' writing between 1 and 4294967295 bytes into a region of size 0 [-Wstringop-overflow=] ../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptDataBuffer.cpp:241:44: note: destination object of size 0 allocated by 'operator new []'

Motivation and context

cleaner compile output and possible fix application crash if size passed to method is 0

How has this been tested?

Compile and runtime on LibreELEC and CoreELEC.

What is the effect on users?

N/A

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • Student submission (PR was done for educational purposes and will be treated as such)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

In member function 'ReallocateBuffer',
    inlined from 'SetBufferSize' at ../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptDataBuffer.cpp:172:32,
    inlined from 'Load' at ../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptStreams.cpp:106:33:
../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptDataBuffer.cpp:245:23: warning: '__builtin_memcpy' writing between 1 and 4294967295 bytes into a region of size 0 [-Wstringop-overflow=]
../../kodi-e495e26f477d4de8a7e6c2fac4acbe1a15e22242/.aarch64-libreelec-linux-gnu/../lib/libUPnP/Neptune/Source/Core/NptDataBuffer.cpp:241:44: note: destination object of size 0 allocated by 'operator new []'
@enen92 enen92 added Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality Backport: Needed Component: UPnP v22 Piers labels Jun 25, 2024
@enen92 enen92 added this to the "P" 22.0 Alpha 1 milestone Jun 25, 2024
@enen92
Copy link
Member

enen92 commented Jun 25, 2024

@vpeter4 interested in handling the backport?

@vpeter4
Copy link
Contributor Author

vpeter4 commented Jun 25, 2024

interested in handling the backport?

Sure.

@enen92 enen92 merged commit a95f8b6 into xbmc:master Jun 25, 2024
2 checks passed
@vpeter4 vpeter4 deleted the libUPnP-memory-22 branch June 26, 2024 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport: Done Component: UPnP Type: Fix non-breaking change which fixes an issue Type: Improvement non-breaking change which improves existing functionality v22 Piers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants