Changeset c758dd299ee12494f2b28e51109e70ba67099f92
- Timestamp:
- 10/09/07 08:48:49
(1 year ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1191912529 +0000
- git-parent:
[8acbb8ac692b609fe4c43bf06044cf2cea49dadc]
- git-author:
- Rafaël Carré <funman@videolan.org> 1191912529 +0000
- Message:
bonjour: checks asprintf() return value, checks name before using it
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| re40d134 |
rc758dd2 |
|
| 142 | 142 | avahi_address_snprint(a, (sizeof(a)/sizeof(a[0]))-1, address); |
|---|
| 143 | 143 | if( protocol == AVAHI_PROTO_INET6 ) |
|---|
| 144 | | asprintf( &psz_addr, "[%s]", a ); |
|---|
| | 144 | if( asprintf( &psz_addr, "[%s]", a ) == -1 ) |
|---|
| | 145 | return; |
|---|
| 145 | 146 | |
|---|
| 146 | 147 | if( txt != NULL ) |
|---|
| … | … | |
| 154 | 155 | value != NULL ) |
|---|
| 155 | 156 | { |
|---|
| 156 | | asprintf( &psz_uri, "http://%s:%d%s", |
|---|
| 157 | | psz_addr != NULL ? psz_addr : a, port, value ); |
|---|
| | 157 | if( asprintf( &psz_uri, "http://%s:%d%s", |
|---|
| | 158 | psz_addr != NULL ? psz_addr : a, port, value ) == -1 ) |
|---|
| | 159 | { |
|---|
| | 160 | free( psz_addr ); |
|---|
| | 161 | return; |
|---|
| | 162 | } |
|---|
| 158 | 163 | } |
|---|
| 159 | 164 | if( key != NULL ) |
|---|
| … | … | |
| 164 | 169 | else |
|---|
| 165 | 170 | { |
|---|
| 166 | | asprintf( &psz_uri, "http://%s:%d", |
|---|
| 167 | | psz_addr != NULL ? psz_addr : a, port ); |
|---|
| | 171 | if( asprintf( &psz_uri, "http://%s:%d", |
|---|
| | 172 | psz_addr != NULL ? psz_addr : a, port ) == -1 ) |
|---|
| | 173 | { |
|---|
| | 174 | free( psz_addr ); |
|---|
| | 175 | return; |
|---|
| | 176 | } |
|---|
| 168 | 177 | } |
|---|
| 169 | 178 | |
|---|
| … | … | |
| 205 | 214 | services_discovery_t *p_sd = ( services_discovery_t* )userdata; |
|---|
| 206 | 215 | services_discovery_sys_t *p_sys = p_sd->p_sys; |
|---|
| 207 | | |
|---|
| 208 | 216 | if( event == AVAHI_BROWSER_NEW ) |
|---|
| 209 | 217 | { |
|---|
| … | … | |
| 219 | 227 | } |
|---|
| 220 | 228 | } |
|---|
| 221 | | else |
|---|
| | 229 | else if( name ) |
|---|
| 222 | 230 | { |
|---|
| 223 | 231 | /** \todo Store the input id and search it, rather than searching the items */ |
|---|