aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/nrpe2/files/patch-src-nrpe.c
blob: 632b4c1430d4bc78e6a05ff09a6c898a5fa659c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- src/nrpe.c.orig 2007-12-27 05:55:05.000000000 +1030
+++ src/nrpe.c  2008-02-20 19:19:03.000000000 +1030
@@ -1458,8 +1458,10 @@
                        }while(bytes_read==-1 && errno==EINTR);
                }
 
-       if(bytes_read==-1 && output!=NULL)
-           strcpy(output,"");
+           if(bytes_read==-1)
+               *output='\0';
+           else
+               output[bytes_read]='\0';
 
        /* if there was a critical return code and no output AND the command time exceeded the timeout thresholds, assume a timeout */
        if(result==STATE_CRITICAL && bytes_read==-1 && (end_time-start_time)>=timeout){