php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66982 uuid_mac checks wrong bit/byte for valid MAC address
Submitted: 2014-03-30 03:33 UTC Modified: -
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: anthon dot pang at gmail dot com Assigned:
Status: Closed Package: uuid (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: anthon dot pang at gmail dot com
New email:
PHP Version: OS:

 

 [2014-03-30 03:33 UTC] anthon dot pang at gmail dot com
Description:
------------
Currently, uuid.c uses: if(uuid[10] & 0x80)

First, 'uuid' is the 36 character string representation.  This should be 'u'.

Second, the multicast bit is actually the least significant bit.  This should be 0x01.

Propose change to:  if (u[10] & 0x01)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-06 10:42 UTC] remi@php.net
I agree with you, this test is wrong

BTW, testing 0x01 is not correct, as it fails with tested UUID
generated by this ext: 764c5296-07bf-11eb-a648-d5fdb410b4d5

Looks like d5fdb410b4d5 is not the MAC address (e0d55e897ce0), but computed from it

So, for sanity, and to avoid bad mistake, I will simply drop this condition
 [2020-10-06 10:44 UTC] remi@php.net
Automatic comment on behalf of remi
Revision: http://git.php.net/?p=pecl/networking/uuid.git;a=commit;h=48384ee3dc03613107c9568cd3e2bc46bab5fe28
Log: fix bug #66982 uuid_mac checks wrong bit/byte for valid MAC address
 [2020-10-06 10:44 UTC] remi@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 18:01:28 2025 UTC