bugGNU Octave - Bugs: bug #38973, Tiny Bug in base64decode:

 
 

bug #38973: Tiny Bug in base64decode:

Submitter:  None
Submitted:  Mon 13 May 2013 04:28:54 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  cdf
Originator Name:  DAVE GOEL Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.4
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 06 Jun 2015 10:00:59 PM UTC, comment #4: 

The original bug (misplaced paren) has been fixed in the strings package.

https://sourceforge.net/p/octave/strings/ci/768d23a76845a9693db5977f331e72f0722fc28b/

The report may be closed, unless you might want to use it for an improvement of the functions in Octave core.

Oliver Heimlich <oheim>
Mon 13 May 2013 06:09:19 AM UTC, comment #3: 

Yes, this is the right place for the report
but you need to specify it's about a function from a
package.

I'll mark this as an OctaveForge bug and see what's the best
way to deal with it, possibly just obsoleting the functions
base64encode and base64decode in the strings package and relying
on the ones in core Octave.

BTW what version of the strings package do you have?
your Octave is really ancient so your packages may be as well, there is a possibility that the bug has been fixed in more recent versions.

Carlo de Falco <cdf>
Group Member
Mon 13 May 2013 05:58:04 AM UTC, comment #2: 

Ah, I apologize. This is part of forge's "octave-strings" package; I forgot to set the right header field, and couldn't figure out how to go and modify my report.

The octave-forge page brought us here, so I assumed this is the right place for the report.
dave

Anonymous
Mon 13 May 2013 05:26:26 AM UTC, comment #1: 

Where did you get base64encode from?
I see no such function in any version of Octave I have installed (3.2.3, 3.6.4, 3.7.3+)

In the development version there is a function named base64_encode
but it does not display the behaviour you reported:


>> version
ans = 3.7.3+
>> which base64_encode
'base64_encode' is a built-in function from the file libinterp/interpfcn/data.cc
>> base64_encode ([99 99 0 0])
ans = AAAAAADAWEAAAAAAAMBYQAAAAAAAAAAAAAAAAAAAAAA=


notice that in the above the numbers are being treated as double, if I want them to be considered of integer type you need to use an explicit cast


>> base64_encode (uint64 ([99 99 0 0]))
ans = YwAAAAAAAABjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=


I suspect the function you are using is from some additional package rather than from Octave core, can you specify where it comes from?



Carlo de Falco <cdf>
Group Member
Mon 13 May 2013 04:28:54 AM UTC, original submission:  

octave:194> base64encode([99 99 0 0])
error: base64encode is expecting integers in the range 0 .. 255
error: called from:error:   /usr/share/octave/packages/3.2/strings-1.0.7/base64encode.m at line 32, column 5

As you can see, the input was actually in the supplied range.

The problem is a simple displaced paren here in the first conditional of line 32

  elseif (any(X(:)) != fix(X(:)) || any(X(:) < 0) || any(X(:) > 255))

This should be replaced by:


  elseif (any(X(:) != fix(X(:))) || any(X(:) < 0) || any(X(:) > 255))


Thanks.
Dave.
--

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by oheim (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by cdf (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-06 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed
    2013-05-16 jwe CategoryNone Octave Package
        StatusOctave Forge None
    2013-05-13 cdf StatusWorks For Me Octave Forge
    2013-05-13 cdf StatusNone Works For Me
        Assigned toNone cdf

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code