Merge lp:~clint-fewbar/ubuntu/maverick/php5/fix-mssql-segfault into lp:ubuntu/maverick/php5

Proposed by Clint Byrum
Status: Work in progress
Proposed branch: lp:~clint-fewbar/ubuntu/maverick/php5/fix-mssql-segfault
Merge into: lp:ubuntu/maverick/php5
Diff against target: 56 lines (+36/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/mssql_fix_segfault.patch (+28/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~clint-fewbar/ubuntu/maverick/php5/fix-mssql-segfault
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Needs Fixing
Review via email: mp+35476@code.launchpad.net

Description of the change

Fixes segfault, tested on maverick.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Hi Clint, great work on following up with this bug. While your patch is certainly reasonable, it differs from what upstream applied: http://svn.php.net/viewvc/php/php-src/trunk/ext/mssql/php_mssql.c?r1=303375&r2=303374&pathrev=303375

Would it make more sense to use their change for consistency? It's also a somewhat simpler change (and probably what I would have done :).

review: Needs Fixing
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Funny, I just noticed yesterday that upstream had patched it in a different and more elegant way.

I'll update the MP ASAP, thanks for the review Barry!

Unmerged revisions

72. By Clint Byrum

debian/patches/mssql-fix-segfault.patch: Fixes segfault on missing parameters
for mssql. upstream php bug #52843 and (LP: #611316)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-08-25 14:04:57 +0000
3+++ debian/changelog 2010-09-14 21:49:48 +0000
4@@ -1,3 +1,10 @@
5+php5 (5.3.3-1ubuntu7) maverick; urgency=low
6+
7+ * debian/patches/mssql-fix-segfault.patch: Fixes segfault on missing parameters
8+ for mssql. upstream php bug #52843 and (LP: #611316)
9+
10+ -- Clint Byrum <clint@ubuntu.com> Tue, 14 Sep 2010 14:37:37 -0700
11+
12 php5 (5.3.3-1ubuntu6) maverick; urgency=low
13
14 * Undo sybase debugging libraries split: keeping a smaller delta with Debian
15
16=== added file 'debian/patches/mssql_fix_segfault.patch'
17--- debian/patches/mssql_fix_segfault.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/mssql_fix_segfault.patch 2010-09-14 21:49:48 +0000
19@@ -0,0 +1,28 @@
20+From: Clint Byrum <clint@ubuntu.com>
21+Subject: Fix segfault on omitted optional parameters for mssql_connect()
22+
23+* ext/mssql/php_mssql.c: Add checks for null pointers before dereferencing
24+
25+Author: Clint Byrum <clint@ubuntu.com>
26+Bug: http://bugs.php.net/bug.php?id=52843
27+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/611316
28+
29+--- a/ext/mssql/php_mssql.c
30++++ b/ext/mssql/php_mssql.c
31+@@ -551,13 +551,13 @@
32+ }
33+
34+ /* Limit strings to 255 chars to prevent overflow issues in underlying libraries */
35+- if(host_len>255) {
36++ if(host && host_len>255) {
37+ host[255] = '\0';
38+ }
39+- if(user_len>255) {
40++ if(user && user_len>255) {
41+ user[255] = '\0';
42+ }
43+- if(passwd_len>255) {
44++ if(passwd && passwd_len>255) {
45+ passwd[255] = '\0';
46+ }
47+
48
49=== modified file 'debian/patches/series'
50--- debian/patches/series 2010-08-13 00:07:15 +0000
51+++ debian/patches/series 2010-09-14 21:49:48 +0000
52@@ -57,3 +57,4 @@
53 fpm-config.patch
54 lp564920-fix-big-files.patch
55 php52389-pgsql-segfault.patch
56+mssql_fix_segfault.patch

Subscribers

People subscribed via source and target branches

to all changes: