Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2af52896b3d1064726a9915342545039ec5d0f48
Ticket: 2380293fffffffffffffffffffffffffffffffff
binary decode uuencode foo --> segfault
User & Date: ferrieux on 2008-12-12 15:47:08
Changes

  1. icomment:
    OK now I know the algorithm. The off-by-one is the visible part of a larger iceberg: the "cut" variable counts missing bytes in the source (base 64) stream, and is wrongly translated 1-to-1 into missing bytes in the decoded stream. So there's a systematic error of factor 4/3 (since a "cut++" should only count as removing 6 bits).
    
    However, I believe the very principle of allowing non-strict uudecoding is flawed. Indeed, a "BadUU" byte in the middle is just skipped, but I wonder about the perturbation process that this is modelling. Indeed if random bytes are inserted here and there, only those which are fortunately outside the 32..96 range will be filtered out. So I cannot imagine a practical situation where an uuencoded stream would be decoded non-strictly... So the quick patch is enough to avoid crashes, the only remaining error being truncated results for error-filled inputs.
    
    Pat, your feeling ?
    
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"