1 | *** /tmp/openvpn/src/openvpn/console.c 2014-02-01 19:13:45.269980788 +0200 |
---|
2 | --- dev/openvpn/src/openvpn-2.3.2/src/openvpn/console.c 2014-02-01 18:58:07.979952332 +0200 |
---|
3 | *************** |
---|
4 | *** 159,164 **** |
---|
5 | --- 159,165 ---- |
---|
6 | { |
---|
7 | int std_out; |
---|
8 | bool ret = false; |
---|
9 | + ssize_t bytes; |
---|
10 | struct argv argv; |
---|
11 | |
---|
12 | argv_init (&argv); |
---|
13 | *************** |
---|
14 | *** 168,175 **** |
---|
15 | if ((std_out = openvpn_popen (&argv, NULL)) < 0) { |
---|
16 | return false; |
---|
17 | } |
---|
18 | ! CLEAR (*input); |
---|
19 | ! if (read (std_out, input, capacity) != 0) |
---|
20 | { |
---|
21 | chomp (input); |
---|
22 | ret = true; |
---|
23 | --- 169,184 ---- |
---|
24 | if ((std_out = openvpn_popen (&argv, NULL)) < 0) { |
---|
25 | return false; |
---|
26 | } |
---|
27 | ! CLEAR (*input); |
---|
28 | ! |
---|
29 | ! bytes = read (std_out, input, capacity); |
---|
30 | ! |
---|
31 | ! if (bytes == capacity) |
---|
32 | ! { |
---|
33 | ! /* It is better to warn the user instead of silently using truncated input */ |
---|
34 | ! msg (M_FATAL, "Input too long for buffer.", prompt); |
---|
35 | ! } |
---|
36 | ! else if (bytes != 0) |
---|
37 | { |
---|
38 | chomp (input); |
---|
39 | ret = true; |
---|