|  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: -
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
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
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)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-06 10:42 UTC]
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]
Automatic comment on behalf of remi
Log: fix bug #66982 uuid_mac checks wrong bit/byte for valid MAC address
 [2020-10-06 10:44 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 13:03:49 2021 UTC