| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Include null terminator in the bytes copied. Set notif.size as it is done in AlertNotificationService.cpp and AlertNotificationClient.cpp.
|
Build size and comparison to main:
|
Sorry, something went wrong.
There was a problem hiding this comment.
I'm fine with this implementation, but I think that it might be good to also use std::min to avoid overflowing the buffer. (Of course that isn't possible with the current notification strings, but it makes the code more clear if we do that)
Because there are some inconsistencies and incorrect handlings of the notification buffer elsewhere in the code, I'm thinking of adding a constructor to the struct that makes sure it's written correctly. In the meantime, this is a good fix.
Sorry, something went wrong.
|
@FintasticMan Thanks for the review! In general constructor for NotificationManager::Notification that checks for buffer overflows sounds like a very good idea. 👍 P.S. Would you like me to implement this constructor? |
Sorry, something went wrong.
|
I was planning on doing it, but if you want to, go ahead! |
Sorry, something went wrong.
There was a problem hiding this comment.
At a glance seems fine to me - haven't looked at the code around this though
Refactoring this problem away would be better but that can be done another time
Sorry, something went wrong.
|
@mark9064, @NeroBurner Should I do the refactoring (implement a constructor for NotificationManager::Notification that checks for buffer overflows)? |
Sorry, something went wrong.
|
That would be great :) |
Sorry, something went wrong.
|
I have made a new PR with the refactoring: #2347 |
Sorry, something went wrong.
Include null terminator in the bytes copied. Set notif.size as it is done in AlertNotificationService.cpp and AlertNotificationClient.cpp.
Include null terminator in the bytes copied. Set notif.size as it is done in AlertNotificationService.cpp and AlertNotificationClient.cpp.
| Back | FazBrowse Home | New Git URL |
Include null terminator in the bytes copied.
Set notif.size like it is done in AlertNotificationService.cpp and AlertNotificationClient.cpp.