~ubuntu-branches/ubuntu/jaunty/nspr/jaunty-security

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/pr/tests/zerolen.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-05-10 18:40:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100510184010-boghfzlm551mtoag
Tags: 4.8-0ubuntu0.9.04.1
* New upstream release: 4.8
  - Support updating NSS to 3.12.6 and fix CVE-2009-3555 aka 
    US-CERT VU#120541
* adjust patches to changed upstream codebase
  - update debian/patches/30_config_64bits.patch
  - update debian/patches/99_configure.patch
* update shlibs symbols to include new API elements
  - update debian/libnspr4-0d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
#include <stdio.h>
58
58
 
59
 
int main()
 
59
int main(int argc, char **argv)
60
60
{
61
61
    printf("PASS\n");
62
62
    return 0;
127
127
    char buf[1024];
128
128
    PRInt32 nbytes;
129
129
    PRIOVec iov;
 
130
#ifdef SYMBIAN
 
131
    int loopcount=0;
 
132
#endif
130
133
 
131
134
    memset(buf, 0, sizeof(buf)); /* Initialize the buffer. */
132
135
    listenSock = PR_NewTCPSocket();
170
173
    osfd = PR_FileDesc2NativeHandle(acceptSock);
171
174
    while ((nbytes = write(osfd, buf, sizeof(buf))) != -1) {
172
175
        /* empty loop body */
 
176
#ifdef SYMBIAN
 
177
      if (loopcount++>64) break;
 
178
#endif
173
179
    }
174
180
    if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {
175
181
        fprintf(stderr, "write failed\n");
203
209
        fprintf(stderr, "PR_CreateThread failed\n");
204
210
        exit(1);
205
211
    }
 
212
#ifdef SYMBIAN
 
213
    loopcount = 0;
 
214
#endif
206
215
    acceptSock = PR_Accept(listenSock, NULL, PR_INTERVAL_NO_TIMEOUT);
207
216
    if (NULL == acceptSock) {
208
217
        fprintf(stderr, "PR_Accept failed\n");
211
220
    osfd = PR_FileDesc2NativeHandle(acceptSock);
212
221
    while ((nbytes = write(osfd, buf, sizeof(buf))) != -1) {
213
222
        /* empty loop body */
 
223
#ifdef SYMBIAN
 
224
      if (loopcount++>64) break;
 
225
#endif
214
226
    }
215
227
    if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {
216
228
        fprintf(stderr, "write failed\n");
242
254
        fprintf(stderr, "PR_CreateThread failed\n");
243
255
        exit(1);
244
256
    }
 
257
#ifdef SYMBIAN
 
258
    loopcount = 0;
 
259
#endif
245
260
    acceptSock = PR_Accept(listenSock, NULL, PR_INTERVAL_NO_TIMEOUT);
246
261
    if (NULL == acceptSock) {
247
262
        fprintf(stderr, "PR_Accept failed\n");
250
265
    osfd = PR_FileDesc2NativeHandle(acceptSock);
251
266
    while ((nbytes = write(osfd, buf, sizeof(buf))) != -1) {
252
267
        /* empty loop body */
 
268
#ifdef SYMBIAN
 
269
      if (loopcount++>64) break;
 
270
#endif
253
271
    }
254
272
    if ((errno != EAGAIN) && (errno != EWOULDBLOCK)) {
255
273
        fprintf(stderr, "write failed\n");