Skip to content

Use correct types for BER en/decode #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2018
Merged

Conversation

tiran
Copy link
Member

@tiran tiran commented Jan 10, 2018

ber_scanf() and ber_printf() "i" format uses ber_int_t. lber_types.h
defines the type as int but Python code assumes the type to be unsigned
long:

    #define LBER_INT_T int
    typedef LBER_INT_T ber_int_t;

The code was working fine on little endian machines but broke on big
endian machines. ber_int_t is now correctly parsed as signed int.

Fixes: #161
Signed-off-by: Christian Heimes cheimes@redhat.com

ber_scanf() and ber_printf() "i" format uses ber_int_t. lber_types.h
defines the type as int but Python code assumes the type to be unsigned
long:

    #define LBER_INT_T int
    typedef LBER_INT_T ber_int_t;

The code was working fine on little endian machines but broke on big
endian machines. ber_int_t is now correctly parsed as signed int.

Fixes: python-ldap#161
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@codecov
Copy link

codecov bot commented Jan 10, 2018

Codecov Report

Merging #162 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #162      +/-   ##
==========================================
+ Coverage    69.6%   69.61%   +<.01%     
==========================================
  Files          49       49              
  Lines        4731     4732       +1     
  Branches      817      817              
==========================================
+ Hits         3293     3294       +1     
  Misses       1084     1084              
  Partials      354      354
Impacted Files Coverage Δ
Modules/ldapcontrol.c 57.69% <100%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad46c11...2397245. Read the comment docs.

@encukou
Copy link
Member

encukou commented Jan 10, 2018

This is not a regression from python-ldap 2.5, right?

If that's the case, it shouldn't hold back the 3.0 release.

@tiran
Copy link
Member Author

tiran commented Jan 10, 2018

The bad code has been there for a long time, at least 2011. We didn't notice the bug because we just started to test the feature. I can either ship a patch with RPM or we fix it in RC1.

@encukou encukou added this to the 3.0 milestone Jan 12, 2018
@encukou encukou merged commit 2387fe6 into python-ldap:master Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy