monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Non terminated string [PATCH]


From: Christof Petig
Subject: [Monotone-devel] Non terminated string [PATCH]
Date: Sun, 04 Jan 2004 01:37:19 +0100
User-agent: Mozilla/5.0 (X11; U; Linux ppc; de-AT; rv:1.5) Gecko/20031110 Debian/1.5-3

I really had some trouble to get monotone 0.9 working on my powerpc and traced it down to two bugs:

- verify(local_path&) uses the wrong index for it's error message (which I never see, but that is perhaps boost's problem)
- illegal_path_bytes is not NUL terminated

Symptoms:
# ./monotone

*** Error: std::out_of_range: basic_string::at

**** error return code 205
**********  errors detected; see standard output for details  ***********

(once 1st error is fixed:)
# ./monotone

*** Error: unknown type

**** error return code 205
**********  errors detected; see standard output for details  ***********
vocab.cc:151: usage constraint 'N(pos == string::npos)' violated

Platform: Linux/powerpc
(bug #2 seems to be hidden on ix86)

Best regards
   Christof

# Old manifest: 9c9bcf4f21d066b689da54b8cfb0a54c553d919a
# Summary of changes:
#   patch constants.cc 508a5418b3b1217b04d3ecca4ee4068f0c40e35d -> 
d4ad141661535aa4ded475a18a3a05af15ded3fa
#   patch vocab.cc 134174634bc2646cd42e8e976fa76e92afe4a17e -> 
1c6f04a9f067a7e43fe054e1690ba9cc7f115f17
--- constants.cc
+++ constants.cc
@@ -114,7 +114,7 @@
   
   // all the ASCII characters (bytes) which are illegal in a (file|local)_path
 
-  char const illegal_path_bytes_arr[32] = 
+  char const illegal_path_bytes_arr[33] = 
     { 
       0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 
       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 
--- vocab.cc
+++ vocab.cc
@@ -145,7 +145,7 @@
       N(!(*i == "." || *i == ".."),
        F("prohibited path component '%s' in '%s'") % *i % val);
 
-      string::size_type pos = 
val().find_first_of(constants::illegal_path_bytes);
+      string::size_type pos = i->find_first_of(constants::illegal_path_bytes);
       N(pos == string::npos,
        F("bad character '%d' in path component '%s' of '%s'") 
        % static_cast<int>(i->at(pos)) % *i % val);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]