I am having issues getting the correct value out of fboauth_fbid_load. My facebook id is somewhere in the neighborhood of 100 trillion yet the function keeps returning the value 2,147,483,647 for my user.

That function is type casting the facebook id as an integer but I am running on a 32-bit system and the largest integer it can handle is the value it's returning. If I remove the type casting, then everything works just fine.

CommentFileSizeAuthor
#1 fboauth_typecast-1764258-1.patch448 byteskleinmp
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kleinmp’s picture

I'm adding this patch so it's obvious how I fixed it.

quicksketch’s picture

Title: fboauth_fbid_load integer overflow » Facebook IDs in fboauth_fbid_load() may exceed 32-bit integer limit
Status: Active » Fixed

Thanks @kleinmp! I can't believe I made such a silly assumption (especially after marking the column BIGINT in the database). A fellow Lullabot wrote up an article on exactly this topic years ago: http://www.lullabot.com/articles/drupocalypse-now-or-dangerous-integer-h...

I've committed your patch as-is. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.