summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt/apt-0.7.14/allocate-larger-memory.patch
blob: 36e1499005d13ee7baaa972edc8ce2e34010c863 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Method file has died unexpectedly

"Method file has died unexpectedly!", this is because the "char S[1024]"
is not enough for the long the URI, "char S[2048]" would be enough.

It would be boring if we use malloc here since we can't know how much
memory is needed except strelen() every component of it. So similarly
use "char S[2048]" as it did before.

Upstream-Status: Pending
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 apt-pkg/acquire-method.cc |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -95,7 +95,7 @@ void pkgAcqMethod::Fail(string Err,bool Transient)
 	 *I = ' ';
    }
    
-   char S[1024];
+   char S[2048];
    if (Queue != 0)
    {
       snprintf(S,sizeof(S)-50,"400 URI Failure\nURI: %s\n"
@@ -132,7 +132,7 @@ void pkgAcqMethod::URIStart(FetchResult &Res)
    if (Queue == 0)
       abort();
    
-   char S[1024] = "";
+   char S[2048] = "";
    char *End = S;
    
    End += snprintf(S,sizeof(S),"200 URI Start\nURI: %s\n",Queue->Uri.c_str());
@@ -160,7 +160,7 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)
    if (Queue == 0)
       abort();
    
-   char S[1024] = "";
+   char S[2048] = "";
    char *End = S;
    
    End += snprintf(S,sizeof(S),"201 URI Done\nURI: %s\n",Queue->Uri.c_str());
@@ -242,7 +242,7 @@ void pkgAcqMethod::URIDone(FetchResult &Res, FetchResult *Alt)
    to be ackd */
 bool pkgAcqMethod::MediaFail(string Required,string Drive)
 {
-   char S[1024];
+   char S[2048];
    snprintf(S,sizeof(S),"403 Media Failure\nMedia: %s\nDrive: %s\n\n",
 	    Required.c_str(),Drive.c_str());
 
@@ -411,7 +411,7 @@ void pkgAcqMethod::Log(const char *Format,...)
    va_start(args,Format);
 
    // sprintf the description
-   char S[1024];
+   char S[2048];
    unsigned int Len = snprintf(S,sizeof(S)-4,"101 Log\nURI: %s\n"
 			       "Message: ",CurrentURI.c_str());
 
@@ -435,7 +435,7 @@ void pkgAcqMethod::Status(const char *Format,...)
    va_start(args,Format);
 
    // sprintf the description
-   char S[1024];
+   char S[2048];
    unsigned int Len = snprintf(S,sizeof(S)-4,"102 Status\nURI: %s\n"
 			       "Message: ",CurrentURI.c_str());
 
-- 
1.7.10.4