bugGNU Octave - Bugs: bug #31689, md5sum(s,1) reports incorrectly if...

 
 

bug #31689: md5sum(s,1) reports incorrectly if s ends in null character.

Submitter:  None
Submitted:  Thu 18 Nov 2010 01:08:42 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  David Smith Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.4
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 18 Nov 2010 08:32:15 AM UTC, comment #1: 

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/a117dc8ea1b9

This fixes the problem for me so I'm closing this report.

John W. Eaton <jwe>
Group administrator
Thu 18 Nov 2010 01:08:42 AM UTC, original submission:  

md5sum(s,1) doesn't return the correct value for
any strings ending in a nul character.  However, I can
write the string to a file and md5sum(filename) returns
the correct value.


s = "abc\0";
fid = fopen ('tmp.dat', 'wb')
fwrite(fid, s)
fclose(fid)

% this returns 147a664a2ca9410911e61986d3f0d52a (correct!)
md5sum('tmp.dat')

% this returns 900150983cd24fb0d6963f7d28e17f72 (wrong!)
md5sum(s,1)


Further experiments indicate that md5sum(s,1) ignores
strips multiple trailing nuls from strings but respects non-trailing nuls when computing md5sum.

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 jwe (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-11-18 jwe StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code