Created
February 24, 2014 20:34
-
-
Save postwait/9196461 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/modules/external.c b/src/modules/external.c | |
| index 6996446..fad38d1 100644 | |
| --- a/src/modules/external.c | |
| +++ b/src/modules/external.c | |
| @@ -310,7 +310,9 @@ static int external_handler(eventer_t e, int mask, | |
| } | |
| while(data->cr->stderrlen_sofar < (int)data->cr->stderrlen) { | |
| int stderrlen = (int)data->cr->stderrlen; | |
| - if(stderrlen > data->cr->stderrlen_sofar) goto widowed; /* overflow */ | |
| + if((stderrlen - data->cr->stderrlen_sofar) < 0 || | |
| + (stderrlen - data->cr->stderrlen_sofar) > data->cr->stderrlen) | |
| + goto widowed; /* overflow */ | |
| while((inlen = | |
| read(e->fd, | |
| data->cr->stderrbuff + data->cr->stderrlen_sofar, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment