Allocate minimum size necessary in pango text functions. #3473
Conversation
|
Anomaly is causing CI build failure. Code compiles.
|
bd67efc
to
19c6bc5
304dbba
to
476e5af
|
Seems like you added some |
|
Yep, just force pushed. |
476e5af
to
894c8df
894c8df
to
445d948
| strcpy(&buf[sizeof(buf) - sizeof(overflow)], overflow); | ||
| } | ||
| // Add one since vsnprintf excludes null terminator. | ||
| int length = vsnprintf(NULL, 0, fmt, args) + 1; |
emersion
Jan 20, 2019
Member
Nitpick: I prefer to use "length" (or "len") to mean the return value of strlen (aka without the terminating NULL byte) and "size" to mean the value passed to malloc et al (aka including the terminating NULL byte).
|
In what cases do allocation failures need to be handled? Is it always? If that's the case, is that something that wasn't enforced in the past but is now? |
|
Just where it's important. In this case it's possibly exploitable by an evil client which sets its title to something ridiculous that we can't draw. |
|
In a perfect world, the compositor would survive even if the device is running low on memory. |
|
Thanks! |
* Allocate minimum size necessary in pango text functions. * Handle malloc failure.


Almost forgot about this. See here (annoyingly this doesn't link directly to the comment. It's in one of the resolved conversations...).